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.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of database triggers exist?

1135


What are the ansi data types supported in oracle?

947


What are dml statements in oracle?

1095


Explain the use of Merge statement in oracle 11g

1027


Please explain oracle data types with examples?

1069


How to use like conditions in oracle?

1055


What is literal?

1004


How to invoke the data pump export utility?

1187


Explain about your project and its relation to the current job position you are applying to?

1006


Hi Can any one tell me what are the API's used in requisition import.

1923


Why oracle is used?

1058


What is the Tune Query

2291


What are the differences between char and nchar in oracle?

1096


How to export your own schema?

1007


Define the SGA and: How you would configure SGA for a mid-sized OLTP environment? What is involved in tuning the SGA?

2270