Answer the question
In order to leave comments, you need to log in
Fill in missing SQL rows?
There is a request like this:
SELECT DATE_FORMAT(`orders`.`date`, '%d.%m.%Y') as date, SUM((`orders_items`.`price`)*(`orders_items`.`count`)) AS `money` FROM `orders_items`
LEFT JOIN `orders_groups` ON `orders_items`.`order_group_id` = `orders_groups`.`id`
LEFT JOIN `orders` ON `orders_groups`.`order_id` = `orders`.`id`
LEFT JOIN `goods` ON `goods`.`id` = `orders_items`.`good_id`
LEFT JOIN `users` ON `orders`.`user_id` = `users`.`id`
LEFT JOIN `orders_status` ON `orders_status`.`id` = `orders_items`.`status_id`
WHERE date(`orders`.`date`)
BETWEEN '2016-08-02' AND '2016-08-15'
GROUP BY DATE_FORMAT(`orders`.`date`, '%d.%m.%Y')
ORDER BY `orders`.`date` DESC
Answer the question
In order to leave comments, you need to log in
An array of dates can be created by a query (not strong in mysql), something like this:
SELECT DATE_ADD('2016-08-02' ,INTERVAL help_topic_id DAY) as mydate
FROM mysql.help_topic order by help_topic_id asc limit 14
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question