This content has been marked as final. Show 7 replies
Sudhir_N wrote:Don't be ridic; of course there's input. The data in yur check_points table is the input to this query. Post CREATE TABLE and INSERT statements so that people can re-create a version of your table, with just a few rows. Include only the columns that play some role in this problem.
There is no input here only the output has to be provided in column fashion.
Also post the output you want from that sample data, if it is not exactly what you have below.
Eg: select name from employeesIt sounds like you need String Aggregation .
Thanks will result to
I required out put wht i need is the rows should in column wise
i.e ABC XYZ TTD
The following page shows several ways to do it:
If you want three separate columns ('ABC' in one, 'XYZ' in another, 'TTD' in a third), then that's called a Pivot . It's more complicated than string aggregation, so you might want to avoid it.
check following example.
create table temp1 (name varchar2(10),location varchar2(20));
insert into temp1 values ('XYZ','LOC1');
insert into temp1 values ('XYZ','LOC2');
insert into temp1 values ('XYZ','LOC3');
insert into temp1 values ('XYZ','LOC4');
select name, max(decode(rownum,1,location,null)), max(decode(rownum,2,location,null)),
max(decode(rownum,3,location,null)),max(decode(rownum,4,location,null)) from temp1 group by name;