I am new in MS SQL server and oracle database
I have the following query:
SELECT * from TBL1 where adc in ('21','24');
but I need something like this:
DECLARE @sqlq nvarchar(500)
Set @sqlq = '21','23';--(how can I write this)
SELECT* from OPENQUERY([CBSCSDB], 'SELECT * from TBL1 where adc in (@sqlq)');
problem is how can I set value @sqlq
and put it in the select statement in where clause.
Best Answer
You can use table variables