deansatch Posted August 11, 2011 Share Posted August 11, 2011 I have a table where there are multiple rows per order_number. Each row has a column for price and quantity. I want to show a summary e.g. order no: 123, qty: 55, total price: £2222 order no: 454, qty: 65, total price: £2652 etc.... If I use SELECT DISTINCT I can get the rows as one order number per row, but how can I add the price/quantities for each order instead of just getting the single values for these columns? Link to comment https://forums.phpfreaks.com/topic/244517-select-distinct-but-get-the-sum-of-another-column/ Share on other sites More sharing options...
deansatch Posted August 11, 2011 Author Share Posted August 11, 2011 Never mind...I used GROUP BY. Doh! Link to comment https://forums.phpfreaks.com/topic/244517-select-distinct-but-get-the-sum-of-another-column/#findComment-1255956 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.