Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Oracle Miscellaneous > Re: Union Claus...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 6 Topic 6876 of 7199
Post > Topic >>

Re: Union Clause

by Ed Prochak <edprochak@[EMAIL PROTECTED] > May 5, 2008 at 06:46 AM

On May 5, 9:17 am, Mtek <m...@[EMAIL PROTECTED]
> wrote:
> Hi,
>
> This is my query:
>
> SELECT SUM(zcom) + SUM(ze) + SUM(zp)
> FROM
>     (SELECT count(DISTINCT(email)) FROM customers_lookup) zcom
>     UNION
>     (SELECT count(DISTINCT(email)) FROM customers_lookup) ze
>     UNION
>     (SELECT count(DISTINCT(email)) zp FROM customers_lookup) zp);
>
> Basically I want to get a count from the three tables where the email
> address appears in ALL THREE tables.  If an email does not exist in
> all three tables, then I do not want it counted.......
>
> I think I'm barking up the wrong tree with the query above......
>
> John.

But you show only one table in this query, customers_lookup.

Here's a hint in the form of a question:
What is the difference between  the union operation and the join
operation?

hth,
  ed
 




 6 Posts in Topic:
Union Clause
Mtek <mtek@[EMAIL PROT  2008-05-05 06:17:39 
Re: Union Clause
Ed Prochak <edprochak@  2008-05-05 06:46:35 
Re: Union Clause
Mtek <mtek@[EMAIL PROT  2008-05-05 06:56:09 
Re: Union Clause
"fitzjarrell@[EMAIL   2008-05-05 07:58:20 
Re: Union Clause
Mtek <mtek@[EMAIL PROT  2008-05-05 08:24:02 
Re: Union Clause
Peter Nilsson <airia@[  2008-05-05 23:04:12 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 19:34:16 CDT 2008.