can we use order by clause in view in sql server 2005?
CREATE VIEW vw_authors
AS
SELECT TOP 10 PERCENT *
FROM dbo.authors
Group by au_id
ORDER BY au_fname
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes and no. You cannot use
order byin the view itself to specify the order. You can use it for row selection, such as withtop 10. From the MSDN online docs: