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 12»»

RANK - 1 Expand / Collapse
Author
Message
Posted Saturday, January 5, 2013 9:17 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 5:36 PM
Points: 5,601, Visits: 25,005
Comments posted to this topic are about the item RANK - 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 #1403303
Posted Monday, January 7, 2013 12:14 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 11:26 AM
Points: 13,622, Visits: 10,514
Easy one for this Monday morning, thanks!



How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1403433
Posted Monday, January 7, 2013 12:52 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 24, 2014 6:38 PM
Points: 1,371, Visits: 1,560
Ah! Easy one to start the week. Thanks Ron

~ 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 #1403440
Posted Monday, January 7, 2013 1:32 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 @ 5:18 AM
Points: 3,925, Visits: 5,112
Good question to start the week on, thanks Ron

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #1403458
Posted Monday, January 7, 2013 4:09 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, August 4, 2014 5:38 AM
Points: 945, Visits: 558
I don't have adventureworks DB, I answered by keeping the basic diff b/w RANK and DENSE_RANK and got it correct.

Thanks for remebering the basics...


--
Dineshbabu
Desire to learn new things..
Post #1403527
Posted Monday, January 7, 2013 4:29 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 2:58 AM
Points: 1,673, Visits: 1,094
Nice question, I got the answer wrong although I worked it out correctly, by foolishly selecting the wrong answer before thinking what I meant.
Post #1403535
Posted Monday, January 7, 2013 8:14 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, August 29, 2014 7:56 AM
Points: 1,860, Visits: 1,398
Great question, unfortunately I got it wrong. I got click happy this morning.



Everything is awesome!
Post #1403641
Posted Monday, January 7, 2013 8:14 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: Thursday, June 12, 2014 4:19 AM
Points: 701, Visits: 1,145
Thanks for the question. Wasn't real familiar with these functions and I paid for it.
Post #1403643
Posted Monday, January 7, 2013 9:59 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 6:17 PM
Points: 8,742, Visits: 9,291
This would have been a good question and easy to get right if the schemaname had been spelt "Sales" instead of "SALES". However, I happened to remember that the database database collation for AdventureWorks2008R2 is Case Sensitive. Or at least that's what it is when installed out of the box on my laptop. My server default collation is NOT case sensitive, so it wasn't picking up case sensitivity from my server default, it's in AdventureWorks as supplied by MS. So I answered "neither" instead of "rank", because both queries will fail with an invalid oject name error.

Apparently the spelling was a mistake, since that was not the "correct" answer. Not at all an error I would expect to see in one of your questions, Ron! I can't see how the queries can have been tested.


Tom
Post #1403725
Posted Monday, January 7, 2013 10:07 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 10:24 AM
Points: 5,977, Visits: 8,239
L' Eomot Inversé (1/7/2013)
This would have been a good question and easy to get right if the schemaname had been spelt "Sales" instead of "SALES". However, I happened to remember that the database database collation for AdventureWorks2008R2 is Case Sensitive. Or at least that's what it is when installed out of the box on my laptop. My server default collation is NOT case sensitive, so it wasn't picking up case sensitivity from my server default, it's in AdventureWorks as supplied by MS. So I answered "neither" instead of "rank", because both queries will fail with an invalid oject name error.

Apparently the spelling was a mistake, since that was not the "correct" answer. Not at all an error I would expect to see in one of your questions, Ron! I can't see how the queries can have been tested.

Tom, AdventureWorks is available in different flavors. Apparently, you downloaded and installed the case sensitive version, but there is a case insensitive version as well.

I think the question could have been shortened to simply present two queries, one with RANK() and one with DENSE_RANK(), and then ask which of the two could have produced the given output. That would have made it more clear that the reader should focus on the difference between those two functions.

That being said - I do like the question! Thanks, Ron!



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1403729
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse