本帖最后由 yao970953039 于 2014-07-04 00:29:13 编辑

解决方案 »

  1.   

    不知道你是不是想要这样类似的结果
    select *,(select count(*) from teb) as total from teb
      

  2.   

    SELECT a.id,max(a.id) from pay_log as a JOIN
    (SELECT uid,count(*) as count FROM pay_log where is_pay == 1 group by uid) as b
    WHERE a.id=b.uid
      

  3.   

    SELECT a.id,max(a.id) 
    from pay_log as a JOIN
    (SELECT uid,count(*) as count FROM pay_log where is_pay == 1 group by uid) as b
    WHERE a.id=b.uid