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

How to export data to a csv file?

632


How translate command is different from replace?

552


How to filter out duplications in the returning rows using oracle?

648


Does oracle charge for java?

597


From the following identify the non schema object: packages, triggers, public synonyms, tables and indexes.

610






Is oracle an open source?

642


What is an Oracle index?

1185


Why cursor variables are easier to use than cursors?

577


How to join two tables in a single query using oracle?

574


Explain an exception and its types?

617


How remove data files before opening a database?

570


Why do you create or replace procedures rather that drop and recreate.

553


Explain compound trigger in oracle?

563


What is a relational database management system?

685


How to install oracle database 10g xe?

575