Saturday, September 28, 2013

query with where condition


DECLARE
@column varchar(50) = ''
SELECT @column = COALESCE(@column+'' ,'')+c.[column] FROM (
select 'a = 1' [column]
union
SELECT ' and b = 2')c

SELECT '('+@column+')'





Regards, Dineshkumar,

Please 'Mark as Answer' if my post answers your question and 'Vote as Helpful' if it helps you



Dineshkumar's BI Blog


No comments:

Post a Comment