Skip to content

Tag: sql-server-2016

how to add select statement in IN clause in pivot

iam using pivot table in SQL query.. i need to make some columns as rowss, but i need to use select statement in IN clause where we givt option like this normally we give option like but with select statement its giving me error?? what can be done. Answer use this i got answer from some of google posts

Sql Grouping insight Xml

I need to get different row data to 1 row based with id and need to group by its status. I tried in several ways and finally found a solution using xml, but when I use xml I don’t get the output I want. This is a sample code I used to try the logic. returned output: expected output: Answer