Can JOIN or UNION collapse mutiple rows for use in a subquery

Posted by justSteve on Stack Overflow See other posts from Stack Overflow or by justSteve
Published on 2010-05-14T16:00:25Z Indexed on 2010/05/14 16:04 UTC
Read the original article Hit count: 177

Filed under:

I'd like to get all tags that match a given id where:

select tag where id = 101 //returns 4 rows
soup
nuts
juice
milk

Only now, i'd like to use that as a subquery -

select idList, (select tag where id = 101) itemsOnList, shopper from assignedLists

becomes:

10 | soup,nuts,juice,milk | Mom

© Stack Overflow or respective owner

Related posts about tsql