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
A collection of a same kind of entities is known as an Entity Set or entity type. Example: For the COLLEGE database defines earlier objects of concern are Students, Faculty,

For each m:n relationship type R, we make a new table (say S) to represent R. We also contain the primary key attributes of both the participating entity types as a foreign key att

external and internal mapping with examples

What is difference between TRUNCATE and DELETE? - Truncate can't be rolled back whereas Delete can be. - Truncate keeps the lock on table whereas Delete keeps the lock on ea

A relation has: Relational Schema Relation instance Relational Schema: A relational schema shows the relation's name, its attributes and the domain of every a

Explain the term- Periodic recomputation Periodic recomputation:  Base values are often updated in bunches. Sometimes, it is possible to just recompute all derived attributes p

Describe association design of an object by giving one suitable example of it. The Design of Associations Associations are "glue" of advanced object oriented analysis and

Describe the advantage of State chart Diagram A state chart represents a state machine, emphasizing flow of control from one state to other. A state machine is a behaviour whi

OPENCART - Want Massive amount of products Imported through CSV We have a massive list of products that would take completely too long to do data entry. We require a slick progr

Structure Of Distributed Database: A distributed database system haves of a collection of sites, each of which keeps a local databases system. Every site is able to process local