I need a really simple PIVOT query for some data, something that turns data like this:
SELECT ID, Type, Count(Type)
FROM MyTable
ORDER BY ID, Type
ID Type Count
101 TypeOne 4
101 TypeTwo 2
101 TypeThree 1
Into
ID TypeOne TypeTwo TypeThree TypeFour
101 4 2 1 0
This is the simplest example of a PIVOT, I'm trying to wrap my head around it.
Hello,
As an expert in SQL, i can write the required query for this purpose. I guess you are using ms sql server, right. Looking forward to have a positive response from you.
Question: Is Type1-Type4 fixed for this data?
Thanks
$19 USD v 0 dnevu
5,0 (237 ocen)
7,6
7,6
4 freelancerjev je oddalo ponudbo s povprečno vrednostjo $18 USD za to delo
Dear Client, I can help you with your task of pivot in SQL, I am a senior developer with rich experience. Lets talk to discuss your requirements. Regards.
I have 7 + years of experience into extensive sql development using multiple RDBMS suh as oracle, mysql, mssql postgre.
I have a query for pivoting data which i hv written recently for my application purpose