用统计就行了嘛
select groupid,count(groupid) from table where layer=1 and username='liu'

解决方案 »

  1.   

    我要在语句里判断出count(groupid) 是不是大于1通过语句返回符合要求的
      

  2.   

    或者说
    if exists(SELECT groupid,count(groupid) from table
    GROUP BY groupid
    HAVING COUNT(groupid)>1))
    print '已经回复'
      

  3.   

    不好意思,我没有QQ,因为我在公司上网,也不是经常能够,所以只能用Email:[email protected]
      

  4.   

    SELECT groupid,COUNT(groupid)
           FROM table 
           WHERE layer=1 AND username='liu'
           GROUP BY groupid
           HAVING COUNT(groupid)>1))