Skip to content

Instantly share code, notes, and snippets.

@ABM-Dan
Created January 27, 2016 21:26
Show Gist options
  • Save ABM-Dan/16ee7591b5ac8d856983 to your computer and use it in GitHub Desktop.
Save ABM-Dan/16ee7591b5ac8d856983 to your computer and use it in GitHub Desktop.
SELECT l.*, MAX(s.sale_ts) FROM location AS `l` LEFT JOIN sales AS `s` ON l.id = s.location_id GROUP BY(s.location_id);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment