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: Tuesday, October 14, 2014 10:58 AM
Points: 5,333, Visits: 25,272
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


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 1:24 PM
Points: 1,010, Visits: 2,303
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
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
Post #1458531
Posted Friday, May 31, 2013 1:53 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: Today @ 12:51 AM
Points: 3,067, Visits: 955
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


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 10:32 AM
Points: 4,023, Visits: 5,323
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


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 4:04 AM
Points: 1,735, Visits: 1,144
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: Tuesday, September 30, 2014 7:38 AM
Points: 1,823, Visits: 904
*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: 2 days ago @ 1:49 AM
Points: 1,356, Visits: 492
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
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 11:54 AM
Points: 4,246, Visits: 3,686
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
String Splitting with True Performance
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: 2 days ago @ 12:58 AM
Points: 1,127, Visits: 1,598
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: Thursday, October 16, 2014 10:02 AM
Points: 1,372, Visits: 1,566
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