Better way (more efficient) to find existance of row

From: Lyall Barbour <lyallbarbour_at_sanfranmail.com>
Date: Tue, 21 May 2013 10:26:27 -0400
Message-ID: <20130521142628.192420_at_gmx.com>



Hello,
 I'm trying to find out if there's a better/faster way to find the existence of a row. The vendor has this query:
select 'Y' from <table> c where c.<col1> = a.<col1> and rownum = 1 I made this query:
select 'Y' from <table> c where c.<col1> = a.<col1> group by a.<col1> having count(a.<col1>) >= 1 I feel like there's a better way. FYI a. table alias is from the outer FROM clause. Thanks!
Lyall Barbour
--
http://www.freelists.org/webpage/oracle-l
Received on Tue May 21 2013 - 16:26:27 CEST

Original text of this message