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 |
How can we find out the current date and time in oracle?
How do you get nicely formatted results from an oracle procedure that returns a reference cursor?
How to call a stored function in oracle?
Point out the difference between user tables and data dictionary?
How to open a cursor variable?
you are sorting a table using "order by"(descending) clause of a column which contains a null value...whether that row containing null value will come first or last in the output??
What is a proxy class?
Name the three major set of files on disk that compose a database in Oracle?
What is the exact use of Collections?
What is an Integrity Constrains ?
how the indexes are stored in the Oracle Database?
Can select statements be used on views in oracle?