Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!usc!ucsd!ogicse!milton!ejbell@milton.u.washington.edu From: ejbell@milton.u.washington.edu (Eric Bell) Newsgroups: comp.databases Subject: SQL, using IN with multi-column keys Message-ID: <6410@milton.u.washington.edu> Date: 16 Aug 90 18:25:34 GMT Sender: ejbell@milton.u.washington.edu Distribution: usa Organization: University of Washington, Seattle Lines: 26 SQL allows you to easily determine if a single value is in a list. For example: select * from data where data.cnum in (select cnun from list); This is great if cnum is the key for the 'data' table. But what do you do if the key is comprised of multiple columns? Can you do something like: select * from data where {data.cnum,data.cic} in (select cnum,cic from list); Or do you have to do a join? It seems like this would come up over and over again, and I'm surprised that SQL doesn't support looking up a tuple in a list. Or am I wrong? Eric Julian Bell Business Administration Computer Services, DJ-10 University of Washington Seattle, WA 98195 (206)543-7125 ejbell@byron.u.washington.edu