Advertisement
mikolajmki

WSDBD_LAB7

Dec 6th, 2021
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.72 KB | None | 0 0
  1. select
  2. c.customerkey, c.lastname, c.firstname, oc.channelname
  3. from orderheader oh
  4. right join customer c on c.customerkey = oh.customerkey
  5. full join orderchannel oc on oc.channelkey = oh.channelkey
  6. where oc.channelkey is null
  7. order by 2,3
  8.  
  9. select distinct
  10. *
  11. from
  12. paymentmethod pm
  13. cross join deliverymethod dm
  14. left join orderheader oh on oh.deliverymethodkey = dm.deliverymethodkey
  15. and pm.paymentmethodkey = oh.paymentmethodkey
  16. order by oh.orderkey nulls first
  17.  
  18. select distinct
  19. *
  20. from
  21. paymentmethod pm
  22. cross join deliverymethod dm
  23. left join orderheader oh on oh.deliverymethodkey = dm.deliverymethodkey
  24. and pm.paymentmethodkey = oh.paymentmethodkey
  25. where oh.orderkey is null
  26. order by oh.orderkey nulls first
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement