id=1111 and fighi="1AoHere" id=3333 and fighi="3AoHere" id=1111 and fighi="12AoHere" idl=3333 and fighi="32AoHere" id=1111 and fighi="11AoHere" id=3333 and fighi="31AoHere" id=11121 and fighi="12AoHere" idl=33332 and fighi="32AoHere"
1AoHere,12AoHere,11AoHere all these for id=1111 3AoHere,32AoHere,31AoHere all these for id =3333
SELECT Id, fighi= STUFF((SELECT ',' + CONVERT(VarChar(10), fighi) FROM MyTable b WHERE b.Id = a.lId FOR XML PATH('')), 1, 1, '') FROM MyTable a WHERE Id IN (1111, 3333) GROUP BY Id
SELECT ID, FIGHI FROM TableName WHERE ID IN (111, 333)
SELECT ID, FIGHI FROM TableName WHERE (ID =111) OR (ID =333)
AND
WHERE
ID
111
333
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)