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 different approaches for database design? There are two basic approaches for database design which are as follows: Attribute driven: It compiles a list of att

A video rental company has several branches. The data held on each branch is the branch address made up of street, city, state, and zip code, and the telephone number. Ea

Describe the four main ways of optimising disk block access. Ans: a. Disk  b. Non-volatile writes buffers c. File organization (Clustering) d. Log-based file system

Ask Write the SQL code that will create the table structure for a table named EMP _1. This table is a subset of the EMPLOYEE table. The basic EMP_1 table structure is summarized in


What is Identity? Identity (or AutoNumber) is a column that automatically produces numeric values. A start and increment value can be set, but most DBA leave these at 1. A GUID

For every n-ary relationship type R where n>2, we make a new table S to represent R. We contain as foreign key attributes in s the primary keys of the relations that show the parti

I am doing research in this area, especially in sime join and join efficacy when several relations have been queried. Relations located in different sites. I need something like n

Related fields in a database are grouped in which form? Related data fields in a database are grouped to form a data record. (A record is a collection of related fields)

What do you understand by transitive dependencies? Define with an example any two problems that can take place in the database if transitive dependencies are available in the datab