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
What is oracle data type?
What is the difference between a primary key & a unique key?
How to calculate date and time differences in oracle?
How to write numeric literals in oracle?
Explain the characteristics of oracle dba?
What are nested tables?
How to run the anonymous block again?
What is the use of oracle?
Explain the difference between replace() and translate() functions in oracle?
How can I create database in oracle?
What is a subquery?
What are the attributes that are found in a cursor?
What is instant client oracle?
What is a read write transaction in oracle?
How to load data through external tables?