I want to use distinct in an equasion so that a line only shows to the page once, but how do i get values from all lines in the database.
so if I have these lines in the database:
table headings : fruit, cost, amount
potatoes, 10, 10
potatoes, 20, 10
potatoes, 15, 15
potatoes, 17, 10
I want only potatoes to show to the screen once (so I will use "select distinct fruit"
, but i want the sum of the amount column (10+10+15+10).
any ideas how i get the sum of amount column?
so if I have these lines in the database:
table headings : fruit, cost, amount
potatoes, 10, 10
potatoes, 20, 10
potatoes, 15, 15
potatoes, 17, 10
I want only potatoes to show to the screen once (so I will use "select distinct fruit"
any ideas how i get the sum of amount column?