Skip to content

Instantly share code, notes, and snippets.

@agawronski
Created December 11, 2017 05:28
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 agawronski/a74bb16784381ed24d1c3b9566d262a1 to your computer and use it in GitHub Desktop.
Save agawronski/a74bb16784381ed24d1c3b9566d262a1 to your computer and use it in GitHub Desktop.
Asking some basic questions about the purchaseorderdetail table.
select *
from purchasing.purchaseorderdetail
limit 10;
-- Are there returns?
select *
from purchasing.purchaseorderdetail
where orderqty <= 0
limit 10;
-- Why does receivedqty + rejectedqty not always equal to orderqty?
select *
from purchasing.purchaseorderdetail
where (receivedqty + rejectedqty) != orderqty
limit 10;
-- perhaps they were rejected back to the manufacturer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment