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
What is partitioned table in Oracle?
How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?
How to manage transaction isolation level?
What is the difference between substr & instr functions?
What would you do with an in-doubt distributed transaction?
How to enter a new row into a table interactively?
How to use an explicit cursor without open statements?
Difference between varchar and varchar2 data types?
What privilege is needed for a user to create views in oracle?
What do you mean by merge in oracle and how can we merge two tables?
Explain table?
What privilege is needed for a user to connect to oracle server?
what is the scripts in data base?
How to select an oracle system id (sid)?
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?