mysql题目求每个name对应的数量都大于3的信息【多测师_王sir】【软件测试】

题目:
求每个name对应的数量都大于3的信息

 

SELECT tt.name FROM 
(
      SELECT c.* FROM ceshi c WHERE  c.number >=3 AND NOT EXISTS(
  SELECT 1 FROM ceshi  a WHERE  a.number < 3 AND c.name = a.name
      ) 
) tt GROUP BY tt.name;


 SELECT c.* FROM ceshi c WHERE  c.number >=3 AND NOT EXISTS(
  SELECT 1 FROM ceshi  a WHERE  a.number < 3 AND c.name = a.name
      ) ;

 

posted @ 2019-08-09 12:02  多测师_树哥  阅读(293)  评论(0编辑  收藏  举报