authorname    rq                     qdsj             xbsj
乌玉兰    2011-07-04 2011-07-04 09:00:11
乌玉兰    2011-07-04            2011-07-04 16:26:00查出结果:authorname    rq                     qdsj             xbsj
乌玉兰    2011-07-04 2011-07-04 09:00:11     2011-07-04 16:26:00
mysql语句查询

解决方案 »

  1.   

    select authorname, rq, qdsj, xbsj
    from 你的表
    group by authorname, rq
      

  2.   

    楼主能不能描述的清楚些?拼接的规则是什么? qdsj和xbsj各是什么意义?
      

  3.   

    表中有无唯一标识的字段?
    select a.authorname,a.rq,a.qdsj,b.xbsj from tt a 
    inner join tt b on a.authorname=b.authorname and a.rq=b.rq and a.qdsj<b.xbsj
      

  4.   

    麻烦lz把字段表示清楚
    authorname rq qdsj xbsj 4个字段
    乌玉兰 | 2011-07-04 | 2011-07-04 | 09:00:11
    还是只有3个字段
    乌玉兰 | 2011-07-04 | 2011-07-04 16:26:00如果3个字段,第三个字段叫sj
    select authorname, rq, min(sj) as qdsj , max(sj) as xbsj
    from table
    group by authorname, rq如果4个字段,那么后面3个日期/时间型字段什么关系
      

  5.   

    select a.authorname,a.rq,a.qdsj,b.xbsj from tt a  
    inner join tt b on a.authorname=b.authorname and a.rq=b.rq and a.qdsj<b.qdsj and a.xbsj<b.xbsj
      

  6.   

    select authorname,rq ,max(qdsj),max(xbsj)
    from table1
    group by authorname,rq