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? Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.