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
What is the difference between the repeatable read and serializable isolation levels? : Transact sql
how to show all tables with 'mysql'? : Sql dba
What is pivot query?
What is snowflake sql?
How do I start sql from command line?
how tsql statements can be written and submitted to the database engine? : Transact sql
What are the different datatypes available in PL/SQL?
How do you delete a table?
Is sql the best database?
What is crud sql?
what is bcp? When does it used? : Sql dba
What is primary key and foreign key?
Can pl sql procedure have a return statement?
What is rollback?
What is the purpose of the sql select top clause?