SQL - How can I concatenate a string based on an ANY result?

escrigshelly

New Member
I'm trying to write a query which aggregates many rows and returns a single string value to indicate whether or not each column contains a value. It needs to examine each column and if the column contains a 'true' value, then concatenate the string result to indicate so.Given (on SQL Server 2008): Col1 | Col2Row1: 0 0Row2: 0 1 I need a result stating "Col1 has no true, Col2 has true" (the comma doesn't matter).My assumption is that I need to combine a \[code\]CASE\[/code\] or \[code\]IF\[/code\] statement with an \[code\]ANY\[/code\] operator, but so far the syntax escapes me.
 
Back
Top