Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7091045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:07:59+00:00 2026-05-28T08:07:59+00:00

can we use order by clause in view in sql server 2005? CREATE VIEW

  • 0

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:08:00+00:00Added an answer on May 28, 2026 at 8:08 am

    Yes and no. You cannot use order by in the view itself to specify the order. You can use it for row selection, such as with top 10. From the MSDN online docs:

    The SELECT clauses in a view definition cannot include the following:
         COMPUTE or COMPUTE BY clauses;
         An ORDER BY clause, unless there is also a TOP clause in the select list of the SELECT statement (a);
         The INTO keyword;
         The OPTION clause;
         A reference to a temporary table or a table variable.

    (a) The ORDER BY clause is used only to determine the rows that are returned by the TOP clause in the view definition. The ORDER BY clause does not guarantee ordered results when the view is queried, unless ORDER BY is also specified in the query itself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can we use aliased field name in ORDER BY clause? For example: SELECT id,
I'm trying to use group by with rollup clause within sql server 2005 but
I want to use ORDER BY clause in functions of SQL Server. But I
I'm working with SQL Server 2005. My query is: SELECT ( SELECT COUNT(1) FROM
Can I use placeholders in a prepared statement for the order by clause of
From here: http://dev.mysql.com/doc/refman/5.0/en/order-by-optimization.html In some cases, MySQL can use an index to satisfy an
When i use SELECT order_id from `order` where `order_id`=U687678601 i get error ERROR 1054:
I can use the MS Word ActiveX control in order to access some parameters
XmlElement has an Order attribute which you can use to specify the precise order
Can I use shared memory on Windows in order to have a common memory

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.