Skip to content

Instantly share code, notes, and snippets.

@Fitzsimmons
Created June 21, 2011 22:30
Show Gist options
  • Save Fitzsimmons/1039093 to your computer and use it in GitHub Desktop.
Save Fitzsimmons/1039093 to your computer and use it in GitHub Desktop.
SELECT DISTINCT lot_code
FROM current_inventory_levels as ia
WHERE ia.site_id = 48 AND ia.sku_id = 'null' AND ia.lot_code ILIKE '%%' AND ia.status = 1
AND ia.location_id = '19080'
GROUP BY ia.sku_id, ia.lot_code, ia.expiry_date
HAVING sum(ia.each_quantity) > 0
ORDER BY lot_code asc
LIMIT 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment