Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Sum and group function

274598Nov 13 2002
Hi.

Appreciate if somebody can help me on this.

I have a table called TEMP_REQUEST. The fields are(CustomerCode,Custname,Createdate,Cntr_Size,ServiceCode,Qty)

Following is the sample data.

90004280 FREIGHT MASTERS LOGISTICS SDN BHD 01/11/2002 20 A 1
90004280 FREIGHT MASTERS LOGISTICS SDN BHD 01/11/2002 20 B 1
90004280 FREIGHT MASTERS LOGISTICS SDN BHD 01/11/2002 20 C 1
90004280 FREIGHT MASTERS LOGISTICS SDN BHD 06/11/2002 40 C 1
90004280 FREIGHT MASTERS LOGISTICS SDN BHD 07/11/2002 20 A 2
90004280 FREIGHT MASTERS LOGISTICS SDN BHD 08/11/2002 20 B 1
90004280 FREIGHT MASTERS LOGISTICS SDN BHD 09/11/2002 40 C 1

Question:
How to generate SQL to generate following output:
Fields are(CustomerCode,Custname,Createdate,ServiceCode,Cntr_Size20,Cntr_Size40,Sum)

90004280 FREIGHT MASTERS LOGISTICS SDN BHD 01/11/2002 A 1 0
90004280 FREIGHT MASTERS LOGISTICS SDN BHD 01/11/2002 B 1 0
90004280 FREIGHT MASTERS LOGISTICS SDN BHD 01/11/2002 C 1 0
90004280 FREIGHT MASTERS LOGISTICS SDN BHD 06/11/2002 C 0 1
90004280 FREIGHT MASTERS LOGISTICS SDN BHD 07/11/2002 A 2 0
90004280 FREIGHT MASTERS LOGISTICS SDN BHD 08/11/2002 B 1 0
90004280 FREIGHT MASTERS LOGISTICS SDN BHD 09/11/2002 C 0 1

Thanks.



Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 11 2002
Added on Nov 13 2002
1 comment
265 views