Re: [SQL] [Q] Merging two queries?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: angelko(at)saw(dot)net
Cc: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] [Q] Merging two queries?
Date: 1999-12-18 22:48:07
Message-ID: 1604.945557287@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

That's an easy one: SELECT ... UNION SELECT ... does exactly what
you need. You can leave DISTINCT off the individual SELECTs because
UNION implies a DISTINCT pass over the merged output. (Use UNION ALL
if you don't want a final DISTINCT pass.)

regards, tom lane

Browse pgsql-sql by date

  From Date Subject
Next Message angelko 1999-12-18 23:00:18 [Q] Merging two queries?
Previous Message Tom Lane 1999-12-18 22:27:41 Re: [SQL] making 'like' queries quicker