How to get Bills Count and Amount in Oracle

Posted by Nandkishorrech under Oracle on 6/9/2014 | Points: 10 | Views : 565 | Status : [Member] | Replies : 1
Hi to all,
i get the records from oracle database in below format
Date TotalBills TotalAmount
6-7-2014 1 100
6-7-2014 1 200
6-7-2014 1 300
6-8-2014 1 100
6-8-2014 1 400
6-9-2014 1 600
6-9-2014 1 200


but, i need bills count and total amount based on date,
please see below output. i need below output.

Date TotalBills TotalAmount
6-7-2014 3 600
6-8-2014 2 500
6-9-2014 2 800



Regards
Nanda Kishore.CH




Responses

Posted by: Gsm_Gsv on: 6/9/2014 [Member] Starter | Points: 25

Up
0
Down
Try this...

SQL> select
date1,
sum(totalbills),
sum(totalamount)
from temp
group by
date1,
totalbills
;

---------------------------------------
Live the life you've dreamed

Regards
MADHU

Nandkishorrech, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response