riddict
New member
Hi all
I am newbie to Laravel, so I need your help to solve a database logic for me.
I have a table name Activity and contain this data
id | Code | Date | Amount
1 | 2001 | 02-02-2016 | 20
2 | 2003 | 02-02-2016 | 14
3 | 2001 | 03-03-2016 | 15
Now, I want to display the data above but only display the same code once but totalling the Amount value.
So the View will be like this
Code Activity name Amount
2001 Activity code 2001 35
2003 Activity code 2003 14
I hope you can understand what I'm trying to ask. I'm sorry for my poor English. And, sorry for the confusing title, I don't know how to name this problem.
I am newbie to Laravel, so I need your help to solve a database logic for me.
I have a table name Activity and contain this data
id | Code | Date | Amount
1 | 2001 | 02-02-2016 | 20
2 | 2003 | 02-02-2016 | 14
3 | 2001 | 03-03-2016 | 15
Now, I want to display the data above but only display the same code once but totalling the Amount value.
So the View will be like this
Code Activity name Amount
2001 Activity code 2001 35
2003 Activity code 2003 14
I hope you can understand what I'm trying to ask. I'm sorry for my poor English. And, sorry for the confusing title, I don't know how to name this problem.