|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Yesterday @ 12:36 AM
Points: 9,
Visits: 285
|
|
| Comments posted to this topic are about the item SELECT TOP
|
|
|
|
|
SSCoach
         
Group: General Forum Members
Last Login: Yesterday @ 3:33 PM
Points: 18,858,
Visits: 12,443
|
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Wednesday, May 22, 2013 7:11 AM
Points: 877,
Visits: 1,159
|
|
Nice question. MSDN link for the same: http://msdn.microsoft.com/en-us/library/ms188385(v=SQL.105).aspx
Thanks
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Today @ 3:28 AM
Points: 3,165,
Visits: 4,345
|
|
Good "Back to basics" question. thanks
____________________________________________ Space, the final frontier? not any more... All limits henceforth are self-imposed. “libera tute vulgaris ex”
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: 2 days ago @ 6:30 AM
Points: 9,410,
Visits: 6,495
|
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Today @ 1:10 AM
Points: 1,998,
Visits: 1,866
|
|
da-zero (12/21/2010)
I'm confused: the correct answer is the row that is returned "most of the time"? If yes, then it isn't a good question, as other answers might be possible. If you can receive other rows with TOP 1, then you should have added an 'It depends' answer. For the rest: nice question  (also good layout and structure of code) I agree with you: no "order by", no default sequence.
But what does this mean?
Always use the top with an ORDER BY clause! Syntax should be appropriate to the hints.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Wednesday, June 12, 2013 9:12 AM
Points: 1,167,
Visits: 646
|
|
| Nice question and layout, but surely the answer should be 'cannot be determined' without the 'order by' clause.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, January 24, 2013 9:59 PM
Points: 1,354,
Visits: 1,299
|
|
| I didn't like this question. I did get it right because I figured it would return 'Ann' most of the time but as the author said, it cannot be guaranteed without an order by clause. There should have been an option that said "Unknown" or "Cannot be 100% certain".
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 1:40 AM
Points: 1,272,
Visits: 4,310
|
|
| I was expecting the answer to be something along the lines of things are always returned in the clustered index order (which would obviously raise questions in any case), but then it's talking about it being indeterminate--if that's the case, why isn't there an "it depends" answer? Question implies one thing, answer says another!
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 1:56 AM
Points: 1,063,
Visits: 4,261
|
|
| Definitely should be "it depends"... I think the question is trying to show what happens when you add a clustered index to a heap and how the data is likely to get re-organised as the index is built.
|
|
|
|