Sum the same records [message #374712] |
Tue, 26 June 2001 04:33 |
Leonard
Messages: 9 Registered: March 2000
|
Junior Member |
|
|
I have a table similiar to the following:
COLA ; COLB
============
AAA ; 123
AAA ; 123
AAA ; 123
AAA ; 155
BBB ; 160
BBB ; 160
CCC ; 155
CCC ; 169
I want to display each record only once as well as total the same record appears in the table. The output should look like this:
COLA ; COLB ; TOTAL
=====================
AAA ; 123 ; 3
AAA ; 155 ; 1
BBB ; 160 ; 2
CCC ; 155 ; 1
CCC ; 169 ; 1
Can someone please help me with the SQL statement to do it?
Thank you!
|
|
|
|
|
|