Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Sybase/Sql server Outer Joins, nulls, and counts

Re: Sybase/Sql server Outer Joins, nulls, and counts

From: <dba_222_at_yahoo.com>
Date: 24 Oct 2006 14:12:27 -0700
Message-ID: <1161724347.745244.292950@m73g2000cwd.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US