Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sybase/Sql server Outer Joins, nulls, and counts
Hmm. The logic was all laid out in the examples in the first posting.
It is the same logic that has worked perfectly hundreds,
probably thousands, of times for me before.
Oracle would not let such a statement even compile. (can't have an AND without first having a WHERE) The compiler would give an error. In which case, I would have just corrected the syntax and got on with it.
The sql server/Sybase compilers allowed the bad syntax.
Thus the statement:
If only the SQL compiler would catch the bad syntax. :(
fitzjarrell_at_cox.net wrote:
> dba_222_at_yahoo.com wrote:
> > Good one! Thanks guys!
> >
> > WHERE e.unique_id is NULL
> > 133295
> >
> >
> > WHERE e.unique_id is NOT NULL
> > 170695
> >
> >
> > This looks much better.
> > Now they both add up to the count with no WHERE clause at all.
> >
> >
> > If only the SQL compiler would catch the bad syntax. :(
> >
> >
>
> It does; you didn't have any 'bad syntax'. What the SQL engine won't
> do is correct for poor logic, which you did have.
>
>
> David Fitzjarrell
Received on Tue Oct 24 2006 - 17:03:57 CDT