ex. one table is having 1 column with 10 records ,
then how to display all the values in row wise ?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / ruchi varma
it will need a cursor.
begin
for cur1 in (select a from Name) loop
dbms_output.put(cur1.a);
end loop;
end;
dbms_output.put -> displays a chr without putting a new line
Is This Answer Correct ? | 0 Yes | 1 No |
what is data independence exactly? give an example
How to convert raw data type into text in oracle? Explain
How to lock and unlock a user account in oracle?
what is the use of triggers in Java program? I mean where do we use triggers in Java programming?
How to name query output columns in oracle?
What is blob data type in oracle?
what is analyze command ? what kind of statistics does it generate?
What is oracle rowcount?
What happens to the current transaction if the session is ended?
Explain an integrity constrains?
if you update view? where we store the data?
What are the values that can be specified for OPTIMIZER_GOAL parameter of the ALTER SESSION Command ?