ritesh.saluja
SSCommitted
Points: 1704
More actions
December 11, 2008 at 4:53 am
#195017
I want to write query something like
Select * from Table_Name where Column1 like ..
now .. in query would be variable and may have n values. It would basically come from a sub query
how to i achive this
Nicholas Cain
SSC-Dedicated
Points: 33009
December 11, 2008 at 6:09 am
#911007
Take a look at sp_executesql within Books Online. You can build a dynamic string and then execute that to get results.
Madhivanan-208264
SSCertifiable
Points: 7516
December 11, 2008 at 6:57 am
#911038
Select * from Table_Name as t inner join (sub query) as s
on t.Column1 like s.col+'%'
Failing to plan is Planning to fail
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply