???????Щ????£????????????е??????Σ?????п??????????????????????????????淶????????????????????????????????????????????

????1?????????????????

??????????????????????????????б??а????????????????????????????е??????????????????????????????У??????????????.???Distinct????????????????????

????Distinct???????SQL ??????г????????У??????????DISTINCT????????????????????У???????????С?

?????????DISTINCT??????????????????軔DISTINCT?????????????????????

????DISTINCT??????Select [disinct|all]select_list

???????

??????1????select?б????????????distinct?????????????????????

??????2??????????distinct?????????????в????????????????????????all????????????????????????????????????

??????3??distinct??????????????У???????????select??????????С?

??????4??distinct??sum??avg??count????????????????????distinct?????????????????????????????????????????????

???????磺??????????????

????select distinct ????????????????????? from tb_BookSell  order by ???

????2???г??????е???????????????

???????HAVING?????????????.??????????????????????????????????г??????.?????????з?????????????having ????е??????????з?????????????????????С?

???????磺?????????鼮

????select ???????????????COUNT (????) as ???????from tb_BookSell  group by ?????????????? having count(????)>=2

????3?????????????ε???

????NULL ??????????δ?????????????????????????????NULL ?????????????is NULL ???ж?NULL ???