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 |
|
Fighter of Foo
Starting Member
2 Posts |
Posted - 2007-06-05 : 10:56:11
|
| Noob question here...I'm trying to pull IDs for all companies on a given list. Trouble is the names don't quite match up, so I'm trying to use a LIKE query. Is there any way to do this on multiple names? select * where company_name like 'name1%', 'name2%'... |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-06-05 : 11:00:33
|
| select distinct company_namefrom tbl tjoin (select name = 'name1%' union select 'name2%' ...) names on t.company_name like names.name==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
Fighter of Foo
Starting Member
2 Posts |
Posted - 2007-06-05 : 11:48:26
|
| grazie |
 |
|
|
|
|
|