Skip to content

Instantly share code, notes, and snippets.

@monimiller
Last active May 4, 2022 13:27
Show Gist options
  • Save monimiller/c24664f6353982b11430bd9e850a71ca to your computer and use it in GitHub Desktop.
Save monimiller/c24664f6353982b11430bd9e850a71ca to your computer and use it in GitHub Desktop.
select
    c.custkey,
    c.name,
    c.address,
    OL.orderstatus,
    OL.orderdate,
    OL.shipdate,
    OL.shipinstruct,
    OL.shipmode
from
    Customer C
    Left Join (
        select *
        from
            orders O
            INNER JOIN lineitem L ON O.orderkey = L.orderkey
    ) OL on C.custkey = OL.custkey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment