Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



I have a table emp. There is only one column in the table. In that , there are only three rows in t..

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

I have a table emp. There is only one column in the table. In that , there are only three rows in t..

Answer / eswar reddy

declare one cursor ,PL/SQL TABLE
IN DBMS MENTIONED PRIOR,LAST,FIRST

Is This Answer Correct ?    0 Yes 0 No

I have a table emp. There is only one column in the table. In that , there are only three rows in t..

Answer / ajitnayak

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

I have a table emp. There is only one column in the table. In that , there are only three rows in t..

Answer / shriram

Garv : Thats right :) Thank you for your answer :)

Is This Answer Correct ?    0 Yes 4 No

Post New Answer

More Oracle General Interview Questions

What are the types of trigger in oracle?

0 Answers  


What is java oracle used for?

0 Answers  


Tell me New Feature of Oracle 10g?

5 Answers   Thermotech,


What is an Index ?

2 Answers  


What are main difference between Stored Procedure and Functions.

6 Answers   CA, Metric Stream,


How to convert numbers to characters in oracle?

0 Answers  


Which dictionary view(s) would you first look at to understand or get a high-level idea of a given Advanced Replication environment?

0 Answers  


What is difference between Rename and Alias?

1 Answers  


how to delete all duplicate records from a table using subquery?

7 Answers   ABC, Cap Gemini,


What is program global area (pga) in oracle?

0 Answers  


What is the use of oracle?

0 Answers  


Explain the use of consistent option in exp command.

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1809)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)