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 are actual and formal parameters?
What is literal?
How to set up autotrace for a user account?
What are the differences between char and varchar2 in oracle?
How to define a record variable to store a table row?
How to invoke the data pump export utility?
What is the difference between view and materialized view in Oracle?
How to connect to a remote server?
How is it different from a normal table?
What is an oracle?
Name the three major set of files on disk that compose a database in Oracle?
what are bitmap indexes? How does they work?
Explain a data segment?
what is the use of system.effective.date variable in oracle?
How to delete a column in an existing table?