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
Is rowid unique in oracle?
What is a cursor and what are the steps need to be taken?
How will you differentiate between varchar & varchar2?
What is partitioned table in Oracle?
What is a system tablespace and when it is created?
Explain the use of parfile option in exp command.
Define the SGA and: How you would configure SGA for a mid-sized OLTP environment? What is involved in tuning the SGA?
Explain about your project and its relation to the current job position you are applying to?
If any one has information regarding interview of NIC (National Informatics Centre),it would be of great help...
What are the types of trigger in oracle?
Explain the different normalization forms?
How to calculate date and time differences in oracle?
How to use subqueries with the exists operator in oracle?
what is the scenario where you take the database to NoArchivelog mode?
Can a formula column be obtained through a select statement ?