你看一下我上面的有错误吗,好像没有错误,
运行cmd进入dos,
用这个语句查询出错,帮我检查一下?谢谢

解决方案 »

  1.   

    用and不行吗?
    SELECT note.author AS first,count(reply.title) AS second
    FROM note,reply
    WHERE note.n_id=reply.parent and second>5
    GROUP BY first
      

  2.   

    对啊,直接WHERE note.n_id=reply.parent and second>5
      

  3.   

    没问题啊。这条SQL能够正常运行。是不是你在运行有没有选择数据库?用USE语句。
    还有一点,你说/r_parent-〉回复对象。而你在SQL里用的是 parent。是不是这里的问题?
    以下是运行后的屏幕截取。
    mysql> SELECT note.author AS first,count(reply.title) AS second
        -> FROM note,reply
        -> WHERE note.n_id=reply.parent
        -> GROUP BY first
        -> HAVING second>5
        -> ;
    +-------+--------+
    | first | second |
    +-------+--------+
    | t1    |      6 |
    +-------+--------+
    1 row in set (0.00 sec)