Skip to content
Advertisement

Tag: sql-server-2016

TSQL PIVOT/UNPIVOT Multiple Summarized Columns

Seems this is a popular topic but I can’t seem to replicate other answers. I have data that is already summarized by month/year for multiple categories. What I’m trying to get is this Here’s the query to provide the data I’ve used PIVOT a bunch of times, but with a single “category” of data. I can’t seem to get anything

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

Advertisement