查询SQL表中某几个字段值有重复的记录
- WBOY原創
- 2016-06-07 17:46:461369瀏覽
SELECT *
FROM BXSK_Tab3
WHERE (skid IN
(SELECT skid
FROM BXSK_Tab3
WHERE (upYear = 2008) AND (upMonth = 4)
GROUP BY skid
HAVING (COUNT(skid) > 1))
and
upyear IN
(SELECT upyear
FROM BXSK_Tab3
WHERE (upYear = 2008) AND (upMonth = 4)
GROUP BY upyear
HAVING (COUNT(upyear) > 1))
)
ORDER BY skid,upyear
陳述:本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn