I make a list out of a column like this

DECLARE
        @theList varchar(max)

        SET @theList = ''

        SELECT @theList = @theList + Cast(Table.ID As varchar(7)) + ','
        FROM          Table
        WHERE     Status <> 'Discontinued'


        SET @theList = SUBSTRING(@theList, 1, Len(@theList) - 1)
--
PRINT @theList
--------------------------------------------------------------------------------------------
Mike Hughes                                      [email protected]
--------------------------------------------------------------------------------------------



On Wed, Apr 15, 2009 at 4:09 PM, Ian Skinner <[email protected]> wrote:
>
> Maya Tulchinsky wrote:
>> Have you tried distinct ?
>
> How would distinct turn:
>
> 1   A
> 1   B
>
> Into
>
> 1 A,B
>
> Rather then just make the second row disappear?
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: http://www.houseoffusion.com/groups/sql/message.cfm/messageid:3213
Subscription: http://www.houseoffusion.com/groups/sql/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6

Reply via email to