how to sort records in sql?

Answer Posted / satish asnani

For EMP table
order by deptno asc OR order by deptno desc

Normally records with NULL values are listed at last. We can
change this by using "NULLS FIRST" or "NULLS LAST" along
with order by clause.

Ex: order by deptno nulls first

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Suppose a student column has two columns, name and marks. How to get name and marks of the top three students.

511


How to select random rows from a table?

505


What is rank () in sql?

516


Which is faster subquery or join?

642


what are the 'mysql' command line arguments? : Sql dba

631






how to concatenate two character strings? : Sql dba

539


Why schema is used in sql?

501


What is pragma in sql?

602


How do you add a column to a table?

587


What is cross join example?

534


What is sql and also describe types of sql statements?

551


What is sql query limit?

499


Which sql statement is used to delete data from a database?

444


what is a unique key ? : Sql dba

531


What are the types of subqueries?

558