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 private procedure oracle?
Write a trigger example in oracle?
What privilege is needed for a user to query tables in another schema?
How to get a list of all background sessions in the database?
Explain the use of file option in exp command.
What is the difference between count (*), count (expression), count (distinct expression)?
How to write a query with a left outer join in oracle?
How to create a stored function in oracle?
How many types of cluster table in Oracle?
What do you mean by a database transaction & what all tcl statements are available in oracle?
How to get execution path reports on query statements?
How to run create database statement again?
How oracle handles dead locks?
What are the four Oracle system processes that must always be up and running for the database to be useable?
Explain implicit cursor.