take one table is t1 and in that column name is f1
f1 column values are
200
5000
3000
7000
300
600
100
400
800
400
i want display the values asc and desc in a single output.
sample output is
f1.a
100
200
300
400
500
600
etc......
and f1.d is
5000
4000
3000
2000
1000
etc...

Answer Posted / jitendra

#The ORDER BY keyword is used to sort the result-set by a #specified column.
#The ORDER BY keyword sort the records in ascending order by #default.
#If you want to sort the records in a descending order, you #can use the DESC keyword.

#1. display the values ascending order

SELECT f1 FROM t1 ORDER BY f1 AS f1.a

#2. display the values descending order

SELECT f1 FROM t1 ORDER BY f1 DESC AS f1.d

Is This Answer Correct ?    0 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the most restrictive isolation level? : Transact sql

554


Is ms sql traffic encrypted?

503


Enlist the data types that can be used in pl/sql?

570


What is pl/sql language case sensitive?

631


Can sql developer connect to db2?

583






Is oracel sql developer written in java?

646


Explain table and field in sql?

581


Explain lock escalation? : Transact sql

702


How to write pl sql program in mysql command prompt?

513


What are the types of queries in sql?

517


What is the difference between drop and truncate commands?

484


Explain the order of sql statement execution?

608


Can we call procedure in select statement?

518


what is the functionality of the function htmlentities? : Sql dba

519


what happens when the column is set to auto increment and you reach the maximum value for that table? : Sql dba

573