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 |
sqlilliterate
Starting Member
40 Posts |
Posted - 2008-09-26 : 03:26:34
|
help me in writing a query... I need to find the particular values from the below list which contains the numbers --> 10, 20, 30My column values...Production Supervisor - WC10Production Supervisor - WC20Production Supervisor - WC30Production Supervisor - WC40Production Supervisor - WC45Production Supervisor - WC50Production Supervisor - WC60Production Technician - WC10Production Technician - WC20Production Technician - WC30Production Technician - WC40Production Technician - WC45Production Technician - WC50Production Technician - WC60But my like condn values (i.e. 10,20,30) comes as a result set from another table.help me with a query like this...(this qry won't work since the subquery results more than 1 row)select * from <table> where <column> like (select no from <table2>)Thanks in advance... |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-26 : 03:28:56
|
may be thisselect t.* from <table> tinner join <table2> t2on t.<column> like '%' + t2.no + '%' |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-09-26 : 03:30:47
|
select t1.* from table1 as t1 inner join table2 as t2 on t1.col like '%'+t2.noMadhivananFailing to plan is Planning to fail |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-09-26 : 03:31:40
|
MadhivananFailing to plan is Planning to fail |
|
|
sqlilliterate
Starting Member
40 Posts |
Posted - 2008-09-26 : 06:21:19
|
Thanks v much Vishak n madhi...It worked :) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-09-26 : 06:22:25
|
quote: Originally posted by sqlilliterate Thanks v much Vishak n madhi...It worked :)
you're welcome |
|
|
|
|
|