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
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. :(
Brian Peasland wrote:
> > select count(*)
> > from E621.dbo.THE_TABLE r
> > LEFT OUTER JOIN
> > E622.dbo.THE_TABLE e
> > On r.unique_id = e.unique_id
> > And e.unique_id is NULL
>
> Try the following:
>
> select count(*)
> from E621.dbo.THE_TABLE r
> LEFT OUTER JOIN
> E622.dbo.THE_TABLE e
> On r.unique_id = e.unique_id
> WHERE e.unique_id is NULL
>
>
> See if that works.
>
> HTH,
> Brian
>
>
>
> --
> ===================================================================
>
> Brian Peasland
> dba_at_nospam.peasland.net
> http://www.peasland.net
>
> Remove the "nospam." from the email address to email me.
>
>
> "I can give it to you cheap, quick, and good.
> Now pick two out of the three" - Unknown
Received on Tue Oct 24 2006 - 16:12:27 CDT