Re: distinct in union

From: Michał Jabłoński <michal.jablonsk_at_gmail.com>
Date: Wed, 6 Oct 2010 02:32:40 -0700 (PDT)
Message-ID: <b60fee63-9ba8-4c88-888a-0941e38a6e36_at_28g2000yqm.googlegroups.com>



On 6 Paź, 11:10, Carlos <miotromailcar..._at_netscape.net> wrote:
> On Oct 6, 10:45 am, Micha³ Jab³oñski <michal.jablo..._at_gmail.com>
> wrote:
>
> > The following query:
> > select a_id,b, c from table1
> > union all
> > select a2_id,b2,c2 from table2
>
> > gives me a result:
>
> > 1,2,3
> > 2,2,3
>
> > but I want only values from second table. What is the most efficient
> > way to do that?
>
> Query the second table ONLY?
>
> WTF!
>
> Cheers.
>
> Carlos.

Sorry, I deleted part:
but I want only values from second table if b=b2 and c=c2 Received on Wed Oct 06 2010 - 04:32:40 CDT

Original text of this message