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

What is partitioned table in Oracle?

832


How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?

1646


How to manage transaction isolation level?

744


What is the difference between substr & instr functions?

825


What would you do with an in-doubt distributed transaction?

1700


How to enter a new row into a table interactively?

743


How to use an explicit cursor without open statements?

806


Difference between varchar and varchar2 data types?

844


What privilege is needed for a user to create views in oracle?

787


What do you mean by merge in oracle and how can we merge two tables?

794


Explain table?

848


What privilege is needed for a user to connect to oracle server?

750


what is the scripts in data base?

1828


How to select an oracle system id (sid)?

781


How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?

2010