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.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / eswar reddy
declare one cursor ,PL/SQL TABLE
IN DBMS MENTIONED PRIOR,LAST,FIRST
Is This Answer Correct ? | 0 Yes | 0 No |
declare
type samp_type is table of VARCHAR2(20)
index by binary_integer;
table_type samp_type;
cursor c1 is
select Colum-Name from Table_name;
begin
open c1;
fetch c1 bulk collect into table_type;
close c1;
for i in reverse 1..4 loop
dbms_output.put_line(table_type(i));
end loop;
end;
Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between sharding and replication?
How to select the name of employee who is getting maximum sal with out using subquery
where do i find oracle interview questions.
Where are the settings stored for each instance in oracle?
I know that i can create a table without a primary key.But is there any significance for that table???? while creating an application.
How to execute a stored program unit?
In which language oracle has been developed?
WHAT IS THE DEFINITION OF DEFAULT CUSTOMER IN AR?
What are various constraints used in SQL?
How do I learn what codesets are available in oracle?
How to use attributes of the implicit cursor in oracle?
what is the difference between no rows returned and null returned?