想把COUNT放到where子句中?

你正在浏览一篇12年前的博客,你确定要继续吗? 我要继续

3 条评论

  1. hehe 于 2007-10-26 @ 22:24:37

    错误做法:select * from user_num where count(user)>=2 group by user;
    正确做法:select * from user_num group by user HAVING count(user)>=2 ;

    这个我这样写可以吗?

    select count(user)>=2 from user_num;

  2. berg 于 2007-10-28 @ 14:28:42

    [Quote ID #60748]

    如果是mysql,应该是不行的
    select count(user) as usernum from user_num where usernum>=2;

    上面这样没问题

  3. 大大 于 2007-11-04 @ 12:19:50

    写的不错正好拿来连手~http://www.bizhitu.cn

发表评论

火花来自思想的碰撞,请留下你宝贵的评论吧: