SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


You need to create a view to increase...


You need to create a view to increase...

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)SSC Guru (141K reputation)

Group: Administrators
Points: 141187 Visits: 19415
Comments posted to this topic are about the item You need to create a view to increase...

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Tom Thomson
Tom Thomson
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25310 Visits: 12488
While this is the only way to create a view (including all the table's rows and) having an order by clause at the top level select in its definition, it doesn't necessarily follw that rows will be returned in that order when selected from the view unless the order clause is repeated at the level abobe the view.
So the chances are that this view does nothing for usability (and hence nothing useful at all).

Tom

Iwas Bornready
Iwas Bornready
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21914 Visits: 885
TomThomson (2/17/2013)
While this is the only way to create a view (including all the table's rows and) having an order by clause at the top level select in its definition, it doesn't necessarily follw that rows will be returned in that order when selected from the view unless the order clause is repeated at the level abobe the view.
So the chances are that this view does nothing for usability (and hence nothing useful at all).
Thanks for the clarity on that. At first I thought I just discovered how to accomplish this in a view and then learn from you that I still have to query the data with an order by clause anyway. Oh well.
Tom Thomson
Tom Thomson
One Orange Chip
One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)One Orange Chip (25K reputation)

Group: General Forum Members
Points: 25310 Visits: 12488
Iwas Bornready (12/23/2015)
TomThomson (2/17/2013)
While this is the only way to create a view (including all the table's rows and) having an order by clause at the top level select in its definition, it doesn't necessarily follw that rows will be returned in that order when selected from the view unless the order clause is repeated at the level abobe the view.
So the chances are that this view does nothing for usability (and hence nothing useful at all).
Thanks for the clarity on that. At first I thought I just discovered how to accomplish this in a view and then learn from you that I still have to query the data with an order by clause anyway. Oh well.

Actually there's a reasonable chance that the data will come back in that order. Of course they might not. Even worse, they might do so this week and not do so next week when the number of rows in the table or the amount of buffer space or something else has changed and made the optimizer do things differently.

Tom

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search