how to sort records in sql?

Answers were Sorted based on User's Feedback



how to sort records in sql?..

Answer / hannan oca

by using order by asc or order by des;

we can sort the data.

Is This Answer Correct ?    16 Yes 0 No

how to sort records in sql?..

Answer / 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

how to sort records in sql?..

Answer / slokh

SELECT * FROM table_name
ORDER BY column_name ASC;

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What is sql select statement?

0 Answers  


What is column?

0 Answers  


define sql

3 Answers   Zensar,


In a table i have columns A,B,C and i have a composite index on columns A,B if so will the following query uses index or not? SELECT sal,name FROM <table_name> WHERE A=<value> AND B=<value> AND C=<value>;

2 Answers   Mastek,


Explain two easy sql optimizations.

0 Answers  






How to get help at the sql prompt?

0 Answers  


how to start mysql server? : Sql dba

0 Answers  


What are the types of sql commands?

0 Answers  


what is the cursor and use of cursor in pl/sql ?

4 Answers  


How do I partition a table in sql?

0 Answers  


What is the purpose of using pl/sql?

0 Answers  


Which command is used to call a stored procedure?

0 Answers  


Categories