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

Home -> Community -> Usenet -> c.d.o.misc -> Union Query Improvement

Union Query Improvement

From: Ray Bannon <raymond.w.bannon_at_boeing.com>
Date: Wed, 14 Feb 2007 14:59:50 GMT
Message-ID: <JDGKBq.19z@news.boeing.com>


Howdy, I've got a query which runs forever and am wondering if there's a more efficient way to write it.

Select id, plan_name from table/view1 where plan_name = 'A' and rownum = 1 union
Select id, plan_name from table/view1 where plan_name = 'B' and rownum = 1 union
Select id, plan_name from table/view1 where plan_name = 'C' and rownum = 1 union.....etc

There are about 100 plan names, and I want one ID/owner for each plan_name. Received on Wed Feb 14 2007 - 08:59:50 CST

Original text of this message

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