July 30, 2012 at 5:03 am
vinu512 (7/30/2012)
GilaMonster (7/30/2012)
Try adding this as a column, and see if it orders 'correctly'. If so, try select into and see if it's still ordered 'correctly'ROW_NUMBER() OVER (ORDER BY (SELECT 1)) As PseudoOrder
Yes, Exactly.
That's what I've been saying.
Nope, what you're saying and what I'm suggesting are not the same thing
ROW_NUMBER() OVER (ORDER BY (SELECT 1)) As PseudoOrder
vs
RowNumber() Over (Order By a.Report_Menu_Code)
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
July 30, 2012 at 5:33 am
GilaMonster (7/30/2012)
vinu512 (7/30/2012)
GilaMonster (7/30/2012)
Try adding this as a column, and see if it orders 'correctly'. If so, try select into and see if it's still ordered 'correctly'ROW_NUMBER() OVER (ORDER BY (SELECT 1)) As PseudoOrder
Yes, Exactly.
That's what I've been saying.
Nope, what you're saying and what I'm suggesting are not the same thing
ROW_NUMBER() OVER (ORDER BY (SELECT 1)) As PseudoOrder
vs
RowNumber() Over (Order By a.Report_Menu_Code)
Oh yes....they aren't....I just jumped on seeing the Row_Number() and didn't read the whole query. I am suggesting that the OP can Order the data according to whichever column he wants and then add the Row_Number().
July 30, 2012 at 5:39 am
vinu512 (7/30/2012)
I am suggesting that the OP can Order the data according to whichever column he wants and then add the Row_Number().
If he had a column to order by, that would be the obvious solution and wouldn't even need a row number. Problem is, he doesn't.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply