Answer the question
In order to leave comments, you need to log in
How to make a selection rounded up to 50?
Hello everyone, you need to calculate the number of orders placed and the amount of orders rounded up to 50.
That is, for example
заказы | сумма
34 | 50
89 | 100
185 | 150
345 | 200
164 | 250
120 | 300
SELECT COUNT( * ) AS orders, ROUND( total, -1 ) AS total
FROM shop_order
WHERE state_id = 'completed'
GROUP BY total
GROUP BY ROUND(total, -1)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question