Sharp Tutorial
Order by in sql

Python

Java

C

C++

HTML/CSS

Java Script

PHP

SQL

C Programs

SQL

  • SQL home
  • SQL introduction
  • SQL install and Run
  • create table
  • drop table
  • alter table
  • Insert into table
  • select query
  • Where Clause
  • Order By /Group By
  • Delete Query
  • Update query
  • Aggregate Function
  • Join Tables
  • SQL Examples
  • SQL Exercise

DBMS

Order By

order by clause is used to sort the selected records either in ascending order or descending order

Order by Clause Syntax  : select * or (column-names)  from <table-name> order by <field-name>;

Order By Clause Example

    
select * from Student order by name;

Above query Displays records sorted on name field in ascending order.

Records may be sorted in descending order by desc .Sorting may be done on Ascending order by asc .By default order by clause sort the records in ascending order.

 
    select * from Student order by fee desc; 
 

Above query display the records sorted on fee in descending order

Multiple order by clause may be combined ..In that case first order by priority is first then second order by is executed

Enquiry about Course

Ask your Question

Click Here

Sharp (2) Tutorials

Video/ C Introduction

Watch video in full size

Video tutorial

Follow by Email
Facebook
Facebook
fb-share-icon
YouTube
Copyright © Sharp Tutorial
Build with WordPress
Wordpress Social Share Plugin powered by Ultimatelysocial
Sharp Tutorial