㈠ sql閲嶅嶆暟鎹鍙鍙栦竴鏉¤板綍
1銆丼QL SELECT DISTINCT 璇鍙
鍦ㄨ〃涓錛屽彲鑳戒細鍖呭惈閲嶅嶅箋傝繖騫朵笉鎴愰棶棰橈紝涓嶈繃錛屼粎浠呭垪鍑轟笉鍚岋紙distinct錛夌殑鍊箋
鍏抽敭璇 DISTINCT 鐢ㄤ簬榪斿洖鍞涓涓嶅悓鐨勫箋
璇娉曪細
SELECT DISTINCT 鍒楀悕縐 FROM 琛ㄥ悕縐
浣跨敤 DISTINCT 鍏抽敭璇
2銆佸瓙鏌ヨ㈤檺鍒惰繑鍥炵粨鏋
SELECT*FROMTestData
WHERE
idIN
(
--鏍規嵁Data鍒嗙被鑾峰彇鏁版嵁鏈灝廔D鍒楄〃
selectmin(id)fromTestData
groupbyData
)