Skip to content

Instantly share code, notes, and snippets.

@gammy
Last active August 29, 2015 14:13
Show Gist options
  • Select an option

  • Save gammy/b45c04e8edd7116d1cb8 to your computer and use it in GitHub Desktop.

Select an option

Save gammy/b45c04e8edd7116d1cb8 to your computer and use it in GitHub Desktop.
SELECT
s.article_id,
a.category,
DATE(s.date_created) AS date_c,
COUNT(s.article_id) AS count
FROM
warehouse_stockunit AS s,
warehouse_article AS a
WHERE
s.article_id = a.id
GROUP BY
s.article_id,
date_c
ORDER BY
date_c DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment