I have a table emp. There is only one column in the table.
In that , there are only three rows in that column.
The value in the first row is 'A' and the value in the
second row is 'B' and the third row is 'C'. Now, my question
is ,

How will you write a select query to display the output as
B
C
A

Note: order by cannot be used coz it gives us output as CBA.
But the output should be BCA.

Answer Posted / garv

SELECT DECODE (EEE,'A','B','B','C','A') EEE
FROM EMP

--EEE IS COLUMN NAME OF TABLE EMP

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

HI ALL, CAN ANYONE TELL ME THE DIFFERENCES BETWEEN SQL CLUSTURS,MSQL CLUSTERS,ORACLE CLUSTERS.......THANKS IN ADVANCE

1774


while i take backup using ibm tsm the following errors occurred: rman-03009 ora-19513 ora-27206 ora-19502 ora-27030 ora-ora19511

3857


What is the database name in oracle?

526


List out the difference between commit, rollback, and savepoint?

609


How to assign data of the deleted row to variables?

571






How to create a temporary table in oracle?

681


What is dynamic proxy?

541


Explain the features of oracle?

588


How to define a sub function?

657


Explain the use of tables option in exp command.

585


How many types of tables supported by oracle?

567


How to create a testing table in oracle?

534


What is a lookup table in oracle?

529


What is oracle rownum?

503


How do I start tns listener?

528