Can we write order by clause inside CTE(Common Table Expression)?

 Posted by vishalneeraj-24503 on 7/1/2014 | Category: Sql Server Interview questions | Views: 1965 | Points: 40

Yes,we can if Top keyword is specified in a Select Statement.Then we can use order by clause.As in case of View we can achieve the same thing if Top keyword is specified.

For Example:-
With CTE_Project_Info

Select Top 10 * From Project_Master Order By Project_Name;

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response