Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

GROUPING SETS - 1 Expand / Collapse
Author
Message
Posted Thursday, May 30, 2013 11:37 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 12:37 PM
Points: 5,471, Visits: 23,521
Comments posted to this topic are about the item GROUPING SETS - 1

If everything seems to be going well, you have obviously overlooked something.

Ron

Please help us, help you -before posting a question please read

Before posting a performance problem please read
Post #1458522
Posted Friday, May 31, 2013 12:43 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Yesterday @ 10:45 AM
Points: 673, Visits: 1,551
Thank you for the post, bucket. Good one.

( not sure how I was suppose to calculate this whole in my head... so I executed the code and picked the answers and and you know what... I selected the wrong answers )


ww; Raghu
--
There are only 10 types of people in the world, those who understand binary, and those who don't.

Note: (as of now) only.. 1 and 4 applies (i am on my way...)
Post #1458531
Posted Friday, May 31, 2013 1:53 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 12:51 AM
Points: 2,925, Visits: 877
I did what any BI consultant would do: I stuffed the numbers into Excel and did a Power Pivot.


Just because you're right doesn't mean everybody else is wrong.
Post #1458550
Posted Friday, May 31, 2013 2:08 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 6:40 AM
Points: 3,683, Visits: 4,818
Really interesting question, thanks Ron
miscalculated the max value sold per client...


____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1458556
Posted Friday, May 31, 2013 3:37 AM


UDP Broadcaster

UDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP BroadcasterUDP Broadcaster

Group: General Forum Members
Last Login: 2 days ago @ 4:49 AM
Points: 1,491, Visits: 976
I confess I'd have struggled to actually work these out in any way so apologise for 'cheating' (I ran it on my desktop instance) although I think learning about grouping sets was worthwhile.

I'd like anyone's advice about when this might be a useful technique to use? I'd admit that in this instance the result set seemed confusing to me and I'd never put something like that in front of (my) clients. If I needed all those bits of data to display as a single presentation, say for a dashboard, I'd probably find writing separate queries less confusing to write and maintain.
Post #1458571
Posted Friday, May 31, 2013 3:54 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, April 07, 2014 5:50 AM
Points: 1,792, Visits: 890
*scratches head* >The highest quantity sold to any custid is 50
A 72
B 47
C 56
D 30

??
Post #1458577
Posted Friday, May 31, 2013 5:20 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 12:16 AM
Points: 1,232, Visits: 447
Sorry, but i hate codes like this. It took several minutes to clear up and make it well formated.
But finally i got it right!

The 50 is ok in my opinion, as you have to take empid also into account.
Post #1458610
Posted Friday, May 31, 2013 5:31 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 10:37 PM
Points: 3,306, Visits: 2,351
I liked the question. I admit I haven't worked with grouping sets and it made me examine them. So, I learned something today, which makes it a good day. Thanks for a good question to finish out the week.


Tally Tables - Performance Personified
Best practices on how to ask questions
Post #1458615
Posted Friday, May 31, 2013 6:09 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, April 08, 2014 2:40 AM
Points: 1,118, Visits: 1,573
I don't agree....I thought the options weren't precise enough....I couldn't work it out in my head....so I executed it to find out that my answers don't match the condition in the question which says "Select 4 options".

So, I went with plain logic instead and select four and got it right. But, I still think that the options weren't precise enough.

Anyways, thanks for the effort Bucket.


Vinu Vijayan

For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden
Post #1458632
Posted Friday, May 31, 2013 6:49 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 2:46 AM
Points: 1,371, Visits: 1,547
Firstly, I would appreciate Ron for coming up with a nice Qotd with an intent to teach grouping sets. Secondly, I do feel, solving this question was rather tricky and I have to take those values into the excel sheet to work out the grouping sets. I know most of you would disagree with me if I say the question was clear enough, but you would appreciate that such questions are worth when it comes to "learning the basics". All glories to Ron for this!!

~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter

Post #1458645
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse