??????????????
??????????????????е??????У???????????????
????????
????SELECT titles.title_id?? titles.title??  publishers.pub_name
????FROM titles FULL OUTER JOIN publishers
????ON titles.pub_id = publishers.pub_id
?????????
???????????????????????SQL2008?????
???????????????????????http://pan.baidu.com/s/1qW1QxA0 ????dqxx
/*?????2007??2??12???1?????????????????????????????????2007??2??12??????1???????????
?漰?????Sales.Customers???Sales.Orders???
??????????????????????????
*/
custid      companyname     orderid     orderdate
----------- --------------- ----------- -----------------------
Customer AHPOP  NULL        NULL
Customer AHXHT  NULL        NULL
Customer AZJED  NULL        NULL
Customer BSVAR  NULL        NULL
Customer CCFIZ  NULL        NULL
...
Customer FVXPQ  NULL        NULL
Customer GCJSG  NULL        NULL
Customer GLLAG  NULL        NULL
Customer GYBBY  NULL        NULL
Customer HFBZG  NULL        NULL
Customer HGVLZ  10444       2007-02-12 00:00:00.000
Customer IAIJK  NULL        NULL
Customer IBVRG  NULL        NULL
Customer IRRVL  NULL        NULL
Customer JMIKW  NULL        NULL
Customer JUWXK  NULL        NULL
...
Customer KIDPX  NULL        NULL
Customer KSLQF  NULL        NULL
Customer KZQZT  NULL        NULL
Customer LCOUJ  NULL        NULL
Customer LCYBZ  NULL        NULL
Customer LHANT  10443       2007-02-12 00:00:00.000
Customer LJUCA  NULL        NULL
Customer LOLJO  NULL        NULL
Customer LVJSO  NULL        NULL
Customer LWGMD  NULL        NULL
Customer MDLWA  NULL        NULL
...
?????ο?SQL??
????--answer:
????select c.custid??c.companyname??o.orderid??o.orderdate
????from Sales.Customers as c
????left join Sales.Orders as o
????on c.custid=o.custid
????and o.orderdate='2007-2-12'
????/*
????1.????Sales.Customers?????c???Sales.Orders?????o???ON??????custid??o.orderdate='2007-2-12'???????????????????????VT1??
????2.??????У??????з??????е??????????NULL???????????VT2
????3.????select?б?????????VT2?в????c.custid??c.companyname??o.orderid??o.orderdate?????????VT3
????*/
???????
????and o.orderdate='2007-2-12' ??? where  o.orderdate='2007-2-12'??????????????????????
????/*????????1???????????
?????漰????Sales.Customers???Sales.Orders???
???????????????
????*/
????custid      companyname
????----------- ---------------
????Customer DTDMN
????Customer WVAXS
?????ο?SQL??
????--answer:
????select c.custid??c.companyname
????from Sales.Customers as c
????left join Sales.Orders as o
????on c.custid=o.custid
????where o.orderid is null
????/*
????1.????Sales.Customers?????c???Sales.Orders?????o???ON??????custid???????????????????????VT1??
????2.??????У??????з??????е??????????NULL???????????VT2
????3.???where???????o.orderid ? null???????????????VT3
????4.????select?б???????c.custid??c.companyname?????????VT4
????*/