Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Union Query Improvement
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