On Jun 27, 10:02 am, --CELKO-- <jcelko...@[EMAIL PROTECTED]
> wrote:
> >> When I see SELECT DISTINCT in anything but an ad hoc query, I know
something is wrong with the query. <<
Keep in mind this is in context of someone coming up asking for help
on a query. DISTINCT would be about the last thing I would add to a
query in that case. I think you understand this, but I say it for the
SQL newbies.
>
> I know what you are saying, but I regard this and a few other things
> as symptoms of bad SQL, not absolute proof of it. I look for a CROSS
> JOIN that wasn't supposed to be there. But SELECT DISTINCT can be
> valid.
Agreed. Maybe you can provide an example, but I cannot recall ever
using DISTINCT in a production query.
>
> Other symptoms are the use of ORs when an IN() would work. Likewise,
> failure to use BETWEEN is another symptom. These tell me he has not
> un-learned his original procedural language.
Good points Joe. thanks for the follow up.
Ed


|