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

if u want to display output in two columns like f1.a,f1.b
then use
select * from(select f1 from t1)a,
select f1 from tt order by f1 desc)b);

if want to display output in same column then use union
like-

select f1 from t1
union
select f1 from t1 order by f1 desc;

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is full join in sql?

519


What is the difference between a primary key and a clustered index?

518


How many tables can you join in sql?

526


What are sql data types?

546


What is embedded sql in db2?

505






What is a native sql query?

494


What is trigger types in sql?

531


Enlist some predefined exceptions?

580


How to write pl sql program in mysql command prompt?

513


What is normalization sql?

509


What is a mutating table and a constraining table?

569


Which is better trigger or stored procedure?

498


What does fetching a cursor do?

613


What is user in sql?

575


Explain what is sql*plus?

670