Skip to content

Instantly share code, notes, and snippets.

@clifgriffin
Created October 14, 2013 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clifgriffin/b926cb06c95b16fcb721 to your computer and use it in GitHub Desktop.
Save clifgriffin/b926cb06c95b16fcb721 to your computer and use it in GitHub Desktop.
SELECT p.*,count(*) as items
FROM (SELECT * FROM wp_shopp_purchase ORDER BY created DESC LIMIT 6) AS p
LEFT JOIN wp_shopp_purchased AS i
ON i.purchase=p.id
GROUP BY i.purchase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment