日期:2014-05-19  浏览次数:20956 次

SQL查询时某一列不重复(先对先得)
SELECT   DISTINCT   OverTimeHead.ApplyNo,   OverTimeList.OverTimeListId
FROM   OverTimeHead   INNER   JOIN   OverTimeList   ON   OverTimeHead.OverTimeHeadId   =   OverTimeList.OverTimeHead
我要Apply不重复

------解决方案--------------------
SELECT DISTINCT OverTimeHead.ApplyNo
FROM OverTimeHead INNER JOIN OverTimeList ON OverTimeHead.OverTimeHeadId = OverTimeList.OverTimeHead