ID CUSTOMER_ID WEEK_NO TOTAL
1 100 31 100
2 101 31 150
3 100 31 400
My table like above,...i need to take add total,if the customer id and week period is same..how to do this..?
Customer_id 100=500 & Customer_id 101=150..(i need result like this))
please do help/...please fast
PHP CODE
Moderator: General Moderators
Re: PHP CODE
We're not doing your homework for you. What have you tried? What errors are you encountering?
-
thomasvt28
- Forum Newbie
- Posts: 10
- Joined: Tue Aug 05, 2014 4:02 am
Re: PHP CODE
used group by to select from database but it returns last row only
Re: PHP CODE
GROUP BY is the correct approach, but it should return two rows. What's your exact query?