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...

ex. one table is having 1 column with 10 records ,
then how to display all the values in row wise ?

Answer Posted / dinesh a.

create table x (col1 number(4));
insert into x value(1);
....
...
insert into x value(10); /* upto 10 rows

then

select
substr(max(decode(rownum,1,col1,0)),1,2),
substr(max(decode(rownum,2,col1,0)),1,2),
substr(max(decode(rownum,3,col1,0)),1,2),
substr(max(decode(rownum,4,col1,0)),1,2),
substr(max(decode(rownum,5,col1,0)),1,2),
substr(max(decode(rownum,6,col1,0)),1,2),
substr(max(decode(rownum,7,col1,0)),1,2),
substr(max(decode(rownum,8,col1,0)),1,2),
substr(max(decode(rownum,9,col1,0)),1,2),
substr(max(decode(rownum,10,col1,0)),1,2)
from x

(where substr only to reduce display size )

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between pre-select and pre-query

1031


Is there a function to split a string in plsql?

983


How to sort the query output in oracle?

969


How would you go about verifying the network name that the local_listener is currently using?

1996


What are the different types of record groups in oracle? Explain each of them

972


Explain a synonym?

971


How to establish administrator authentication to the server?

984


How to use null as conditions in oracle?

1003


What are the uses of a database trigger?

931


Is a rollback possible to any savepoint?

1001


How to connect ms access to oracle servers?

947


Explain the use of compress option in exp command.

969


What are the differences between blob and clob in oracle?

1032


Is java required for oracle client?

928


How to export your connection information to a file?

1076