Answer: Yes, we can use order by clause when defining a view.
The condition is we have to include either TOP or FOR XML clauses also in the query
example:
create view gt as select * from emp order by ename
--Wrong
But
create view gt as select top 5 * from emp order by ename
-- Correct
Asked In: Many Interviews |
Alert Moderator