Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Mondeo
Constraint Violating Yak Guru
287 Posts |
Posted - 2014-06-03 : 05:07:54
|
If I have a simple table like thisid make model1 ford mondeo2 ford escort3 vauxhall corsa4 fiat puntoTo get a list of id's I can do SELECT id FROM table WHERE make='ford' and model='mondeo'But, I have a second table like thismake modelford escortford mondeoetcI want to get all the id's from table 1 that match all the make/model combinations in table 2.How could I do that?Thanks |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2014-06-03 : 05:22:13
|
select t1.idfrom table1 as t1join table2 as t2 on t1.make=t2.make and t1.model=t2.model Too old to Rock'n'Roll too young to die. |
|
|
|
|
|