CHAPTER 3
Joins
125
7 (Optional, advanced)
Return all customers, and for each return a Yes/No value depending on whether the customer placed
an order on February 12, 2007.
■
■
Tables involved: Sales.Customers and Sales.Orders
■
■
Desired output (abbreviated):
custid companyname HasOrderOn20070212
----------- ----------------- ------------------
1 Customer NRZBB No
2 Customer MLTDN No
3 Customer KBUDE No
4 Customer HFBZG No
5 Customer HGVLZ Yes
6 Customer XHXJV No
7 Customer QXVLA No
8 Customer QUHWH No
9 Customer RTXGC No
10 Customer EEALV No
...
(91 row(s) affected)
Do'stlaringiz bilan baham: |