I'm pretty experienced in C#, but still mostly a beginner in SQL.
We have an application in C#, using an MSSQL database.
One part of our application is simply a list of pre-written queries as reports that the application shows by simply running the query and sticking the returned table into a gridView.
The user is requesting a new report that I'm not entirely sure is even possible with just SQL and is going to require manipulation of the returned data to get it to look right.
The data that the users want, in the way they want it presented would require me to be able to take this table:
Date Category Count --------------------- date1 Cat1 x1 date1 Cat2 y1 ... date1 CatN z1
gotten from this query:
select Date, Category, COUNT(*) as 'Count'
from Table
group by Date, Category
turned into this table:
Date Cat1 Cat2 ... CatN --------------------------- date1 x1 y1 ... z1 date2 x2 y2 ... z2
so that I can join it by date to the other half of the data they want.
Long-winded explanation, short question and followup: is this possible to do, no matter how painfully, with just SQL?
If so, how?