Using Order by Clause with Column_Index instead of Column Name - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Monday, July 18, 2011

Using Order by Clause with Column_Index instead of Column Name

Its a very general and regular ways to use Order by clause with Column Name to Specifies the sort order used on columns returned in a SELECT statement.
Syntax :-
  SELECT column_name(s)
FROM table_name
ORDER BY column_name(s) ASC/DESC
I am also using the same method but do you know we can use Column Index (Integer representing the position of column name) instead of specifying the name or column alias in a SQL Server Order By expression.
As:- 

No comments:

Post a Comment