java吧 关注:1,236,810贴子:12,705,970
  • 2回复贴,共1

一个mysql排序取值的问题

只看楼主收藏回复

问题二楼


1楼2015-06-02 11:06回复
    select spUid,COUNT(spUid) as ct,SUM(TIMESTAMPDIFF(MINUTE,startUseTime,stopUseTime)) as aMin,(startUseTime) from
    abilityopen_tollrecord_history where spId='SPCQYOKU' and YEAR(startUseTime)='2015' and MONTH(startUseTime)='6'
    GROUP BY spUid HAVING ct>1
    想取startUseTime字段倒数第二小的值,怎么做呢


    2楼2015-06-02 11:06
    回复
      难道问题太简单了


      3楼2015-06-02 11:10
      回复