Created
December 11, 2017 05:22
-
-
Save agawronski/977375a0d49214c89e1d321527422d1e to your computer and use it in GitHub Desktop.
Basic questions about purchasing orders.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- When did these orders occur ? | |
-- How many records are there? | |
-- How many orders are there? | |
select | |
min(duedate) as min_duedate, | |
max(duedate) as max_duedate, | |
count(*) as num_records, | |
count(distinct purchaseorderid) as num_orders | |
from purchasing.purchaseorderdetail; | |
-- looks like purchaseorderheader has the actual order date | |
select | |
min(orderdate) as min_orderdate, | |
max(orderdate) as max_orderdate, | |
count(*) as num_records, | |
count(distinct purchaseorderid) as num_orders | |
from purchasing.purchaseorderheader; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment