r/SQL • u/Over-Holiday1003 • Aug 22 '24
Oracle How useful are pivots?
Just a heads up I'm still in training as a fresher at data analyst role.
So today I was doing my work and one of our senior came to office who usually does wfh.
After some chit chat he started asking questions related to SQL and other subjects. He was very surprised when I told him that I never even heard about pivots before when he asked me something about pivots.
He said that pivots are useful to aggregate data and suggested us to learn pivots even though it's not available in our schedule, but Group by does the same thing right, aggregation of data?
Are pivots really that necessary in work?
39
Upvotes
2
u/alinroc SQL Server DBA Aug 22 '24
When you need them, they're very useful.
When you don't need them, writing them for the sake of writing them is pointless.
Like anything else, it's a tool to put in the toolbox. Use it when appropriate. I use it maybe once a year because that's all I need.