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 -> Re: WHERE IN query

Re: WHERE IN query

From: <tabates_at_my-dejanews.com>
Date: Thu, 22 Apr 1999 22:28:09 GMT
Message-ID: <7fo7pk$bu1$1@nnrp1.dejanews.com>


  "Joerg Leute" <leute_at_itdesign.de> wrote:
> Isn't it possible to extend a WHERE IN query over 2 columns - first column
> is number and second is char) like
>
> SELECT * FROM TABLE1 WHERE (ID, NAME) IN (SELECT ID_2, NAME_2 FROM TABLE2)
As all earlier persons were addressing the fact that it seems you want both fields to match may I suggest this instead.

Select * from Table1 where ID||Name in (select ID2||Name2 from Table2)

This may or may not be faster, but from my side of the table it is easier to read and almost self-documenting.

Timothy

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Apr 22 1999 - 17:28:09 CDT

Original text of this message

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