July 17, 2002 at 9:39 pm
Folks,
In my work with Sybase SqlAnywhere, we used a command in their version of SQL that would return a comma-delimited list of all the values it found in a field. I am forgetting the name of the command -- perhaps it was LIST() in fact.
For instance, if I had ten salespeople in NY, ten in NJ, and ten in PA, and then ran this query:
SELECT COUNT(Sales_ID), LIST(DISTINCT State_Abbrv) FROM SalesForce
If would get back a result set with one row, having the number 30 in the first field, and the string 'NJ,NY,PA' in the second field.
Is there any comparable command in T-SQL? I'm guessing not, but hoping against hope.
- Tom
July 17, 2002 at 10:00 pm
There is not, but you can fake it (somewhat) with this:
http://www.sqlservercentral.com/columnists/sjones/tamestrings6.asp
Steve Jones
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply