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 / pooja gupta

select f1.a, f2.d from
(select f1 as a from t order by 1) f1,
(select f1 as d from t order by 1 desc)f2

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a commit statement be executed as part of a trigger?

602


Explain the steps needed to create the scheduled job?

565


what are the differences among rownum, rank and dense_rank? : Sql dba

540


Explain the working of primary key?

612


What is the use of non clustered index?

528






What are transaction and its controls?

561


what is a unique key ? : Sql dba

547


Which function is used to return remainder in a division operator in sql?

584


How do I create a memory optimized filegroup?

529


What is cold data?

505


Does sap use sql?

515


How can triggers be used for the table auditing?

594


Does mysql_real_escape_string prevent sql injection?

539


What is group by in sql?

550


what is cross join? : Sql dba

576