how to sort records in sql?
Answers were Sorted based on User's Feedback
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 |
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 |
Answer / slokh
SELECT * FROM table_name
ORDER BY column_name ASC;
| Is This Answer Correct ? | 1 Yes | 0 No |
What are code pages ?
What is difference between sql and excel?
will function return more than one value how
Hi, Can anybody please explain me the flow of the below query. I am not able to understand how this query works. This query is for finding the Nth highest salary.. SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal); If N = 2 then second highest salary will be the o/p. If N = 3 then third highest salary will be the o/p. and so on.. Thanks, Nitin
5 Answers Deloitte, Ness Technologies,
What is basic structure of pl sql?
Does a primary key have to be a number?
In table a 1lakh data is present,in table b 20 thousand data is present, to get unique data from table a and b which join to be considered. whether right outer join or left inner join.
Is crud a cuss word?
What is the purpose of a secondary key?
If a View on a single base table is manipulated will the changes be reflected on the base table?
What is exception? What are the types of exceptions?
What will you get by the cursor attribute sql%rowcount?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)