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 ?

Answers were Sorted based on User's Feedback



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

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

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

Answer / ajit

select wm_concat(rel)
from UPDATE_TEST

Is This Answer Correct ?    0 Yes 0 No

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

Answer / ruchi varma

it will need a cursor.

begin
for cur1 in (select a from Name) loop
dbms_output.put(cur1.a);
end loop;
end;

dbms_output.put -> displays a chr without putting a new line

Is This Answer Correct ?    0 Yes 1 No

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

Answer / vipul

column can be convert in row by using PIVOT function in ORACLE

for eg:

SELECT * FROM(SELECT VMENUNAME,NMENUNO FROM MENU_MASTER) A
PIVOT(MAX(VMENUNAME) FOR NMENUNO IN (6,7,8,9,10,11,1)) PVT

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Oracle General Interview Questions

What is SGA ? How it is different from Ver 6.0 and Ver 7.0 ?

1 Answers   TCS,


What are the differences between date and timestamp in oracle?

0 Answers  


What is the difference between implicit index and explicit index?

2 Answers   TCS,


There is a big table with "n" of rows and 40 + columns .It doesn't have primary key.How do you select the primary key. In other words how do you get the duplicate records.

2 Answers   Microsoft,


Explain drop constraint oracle?

0 Answers  


10. Display the client number, order date and shipping date for all orders where the shipping date is between three and six months after the order date.

3 Answers   Wipro,


What are internal user account in oracle?

0 Answers  


What do you mean by group by clause?

0 Answers  


Explain oracle instance.

0 Answers  


Can we create trigger on view in oracle?

1 Answers  


What are the parameters that we can pass through a stored procedure?

0 Answers  


Explain the use of owner 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)