Click here to Skip to main content
15,912,977 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have one view and i want to sort record inside view not using select * from view.inside that there is one primary key column so how can do it .we can not use order by inside view then how it possible to sort and i want sorting inside view only .thanks in advance
Posted
Updated 30-Aug-12 20:15pm
v2
Comments
[no name] 29-Aug-12 8:20am    
Try using an ORDER BY clause.
AmitGajjar 29-Aug-12 8:41am    
very basic question. even google gives you exact answer.
fjdiewornncalwe 29-Aug-12 9:33am    
I'm pretty sure you are missing some vital information in your question and I think you are talking about the internal arrangement of data within sql server and not the sorting of records which is tied to a select query. If that is the case, then you may really be asking about indexing, but you'll have to confirm that.
AmitGajjar 29-Aug-12 11:27am    
why you want to sort data inside view ?

hi,

Please see the follwing article.
you will get better idea.

http://blog.sqlauthority.com/2010/08/23/sql-server-order-by-does-not-work-limitation-of-the-views-part-1/[^]

Thanks,
Viprat
 
Share this answer
 
use row number inside view you will resolve the problem
 
Share this answer
 
use ORDER BY clause for sorting

Example:
SQL
SELECT * FROM [TABLE_NAME] ORDER BY [COLUMN_NAME];

for more information refer this
http://technet.microsoft.com/en-us/library/ms173288.aspx[^]
 
Share this answer
 
Comments
fjdiewornncalwe 29-Aug-12 9:30am    
My vote of 1: "not using select *"

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900