Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Need help on a query!!!
I have a stupid method.
1. generate a file a.txt
100200 10-11-2002 100200 09-08-2002 100200 10-11-2002 400300 05-06-2002 400300 05-06-2002 500200 01-01-2002 500200 02-02-2001 600100 01-08-2002
2. write a awk script a.awk
BEGIN {myid=0}
{
if (myid==0) {printf "%s %s",$1,$2;myid=$1} else { if (myid == $1) {printf " %s",$2} else {printf "\n%s %s",$1,$2;myid=$1} }
3. awk -f a.awk a.txt
the output is :
100200 10-11-2002 09-08-2002 10-11-2002 400300 05-06-2002 05-06-2002 500200 01-01-2002 02-02-2001 600100 01-08-2002
4. sql*loader
~
Received on Wed Oct 09 2002 - 02:49:16 CDT