SQL2000中统计重复次数

发布网友 发布时间:2022-04-21 00:42

我来回答

6个回答

热心网友 时间:2022-06-16 19:48

SELECT T.A1, COUNT(T.A2) AS A3
FROM ATBLE T
GROUP BY T.A1
HAVING COUNT(T.A2) >= 3

热心网友 时间:2022-06-16 19:49

Select A1,count(A1) as A3
From ATBLE where A2=1
Group by A1 Having count(A1)>3 Order by count(A1) desc

热心网友 时间:2022-06-16 19:49

select a1 ,count(a2) a2 from tablename group by a1 having count(a2)>3

热心网友 时间:2022-06-16 19:50

select a1 , count(*)
from TABLE
where a2 = 1
group by a1
having count(*) >= 3
order by a1 desc;

若a2为字符型 则写为a2 = '1' 就OK了

热心网友 时间:2022-06-16 19:50

SELECT A1, COUNT(A2) AS 次数
FROM ATBLE GROUP BY A1
WHERE (A2 = 1)
HAVING (COUNT(A2) > 3)

热心网友 时间:2022-06-16 19:51

SELECT A.A1,COUNT(*)
FROM TABLE A,TABLE B WHERE A.A1=B.A1
GROUP BY A.A1 HAVING COUNT(A.A2)>=3

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com