Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!voder!blia!jeffb From: jeffb@blia.BLI.COM (Jeff Beard) Newsgroups: comp.databases Subject: Re: Multiple selects Message-ID: <12661@blia.BLI.COM> Date: 9 Oct 90 15:31:22 GMT References: <1990Oct4.072314.27476@monu6.cc.monash.edu.au> <1990Oct9.022119.23438@murphy.com> Reply-To: jeffb@blia.UUCP (Jeff Beard) Organization: Britton Lee Lines: 21 >Select * from supp > where supp_nbr = > > select supp_nbr from quote > where quote_nbr = > select quote_nbr from quote_line > where quote_line.stk_no = p_stk_no > You may try Select * from supp where exists select supp_nbr from quote where exists select quote_nbr from quote_line where quote_line.stk_no = p_stk_no as 'where exists' allows a result SET to be greater than one tuple. Sub-select querys get very inefficient so it would be better to use a single WHERE EXISTS and a sub-select that is colapsed from the above.