Skip to content

Instantly share code, notes, and snippets.

@benphelps
Created April 9, 2012 10:50
Show Gist options
  • Save benphelps/2342826 to your computer and use it in GitHub Desktop.
Save benphelps/2342826 to your computer and use it in GitHub Desktop.
SELECT DISTINCT order_items.pallet_id as 'pallet_id', orders.entry_date as 'last_order' FROM orders JOIN order_items ON orders.order_id = order_items.order_id WHERE order_items.pallet_id = 'DOH 48X42' GROUP BY order_items.pallet_id ORDER BY orders.entry_date DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment