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 |
24. Display the order number for all orders whose average item cost is greater than the overall average item cost across all orders.
I have query like this. select dept_id, max_mark from stude_dept where min_mark= (select min(mini_mark) from stud_dept); How can i optimize this query. Can anyone help me with it
how will I find the first 5 highest salaried employees in each dept in oracle.
Display those managers salary greater than the average salary of his employees?(Based on oracle standard Emp table)
6. Display the client name and order date for all orders using the traditional method.
How to count duplicated values in a column in oracle?
What are transaction isolation levels supported by oracle?
How do I use os authentication with weblogic jdriver for oracle and connection pools?
what is the dual table in oracle?
types of indexes and the rationale behind choosing a particular index for a situation.
How do we get field details of a table?
How is it different from a normal table?