Order by clause-data manipulation language, Database Management System

Order by clause

  • By using this rows can be sorted
  • It is used in the last portion of select statement
  • By default it gets ascending order
  • DESC: is used for sorting in descending order
  • Sorting by column Alias
  • Sorting by column which is not in select list is possible

Example:

SELECT EMPNO, ENAME, SAL*12 "ANNUAL" FROM EMP

ORDER BY ANNUAL;

Example:   //Sorting by multiple columns//; ascending order on department number and descending order of salary in each department.

SELECT ENAME, DEPTNO, SAL FROM EMP

ORDER BY DEPTNO, SAL DESC;

Posted Date: 3/11/2013 1:07:16 AM | Location : United States







Related Discussions:- Order by clause-data manipulation language, Assignment Help, Ask Question on Order by clause-data manipulation language, Get Answer, Expert's Help, Order by clause-data manipulation language Discussions

Write discussion on Order by clause-data manipulation language
Your posts are moderated
Related Questions
What are the disadvantages of file-processing system?  Ans: The Disadvantages of File-Processing System a. Data redundancy and inconsistency - Data redundancy means not nece

Explain the term- Data Flows Data Flows: A data flow connects output of an object or process to input of another process or object. It represents an in-between data value wit

Question : (a) Explain with the help of appropriate examples the difference between ‘Data' and ‘Information'. (b) A digital image is an array of pixels, where each pixel h

In how many parts events are classified Events are classified as four types in UML 1.  Signals 2.  Calls 3.  Passing of Time 4.  Change in State

What is a records management consultation? Our organization is an authority for disseminating your specific requirements and giving you with a solution to effectively manage yo

what are the purposes of dbms in details

During the deletion of a tuple two cases can happen: Deletion of tuple in relation having the foreign key: In this type of case simply delete the desired tuple. For example, in

what is object-identity

What are the states of transaction? The states of transaction are:- a) Active b) Partially committed c) Failed d) Aborted e )Committed   f) Terminated

Define multivalued dependency and 4NF.  Ans:  Multivalued Dependency - Assume R be a relation schema and let α ⊆ R and β ⊆ R. The multivalued dependency  α →→β   holds o