Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Need help on a query!!!

Re: Need help on a query!!!

From: melocy <melocy_at_21cn.com>
Date: 9 Oct 2002 07:49:16 GMT
Message-ID: <92A2A92E0melocy21cncom@130.133.1.4>


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}
             }

    }
END {printf "\n"}

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US