Labels

Wednesday, 23 December 2015

SQL Server - Order By Clause

Order By

                 Order By clause is used to arrange the data either ascending (or) descending order

                * By default order by clause will arrange the data in ascending order only
                * We can apply order by clause on any of the column in a table
                * If you apply order by clause on character column then it will arrange the data in                                    alphabetical order
                * We can apply the order by clause on more than one column in the table
                * We can apply the order by clause only with SELECT command
                * We cannot apply order by clause on Insert, Delete,Update commands
                * If you want to arrange the data in descending order then we have to use desc option


Syntax 
            
             Select * from <T.N> order by <CN1,CN2....CNn>[asc\desc]

No comments:

Post a Comment