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
Difference between pre-select and pre-query
Is there a function to split a string in plsql?
How to sort the query output in oracle?
How would you go about verifying the network name that the local_listener is currently using?
What are the different types of record groups in oracle? Explain each of them
Explain a synonym?
How to establish administrator authentication to the server?
How to use null as conditions in oracle?
What are the uses of a database trigger?
Is a rollback possible to any savepoint?
How to connect ms access to oracle servers?
Explain the use of compress option in exp command.
What are the differences between blob and clob in oracle?
Is java required for oracle client?
How to export your connection information to a file?