select 序号,书名,阅读时间 from table1 where
阅读时间 in (select max(阅读时间) from table1 group by 书名)

解决方案 »

  1.   

    Select a.序号,a.书名,a.阅读时间
     from table1 as a inner join (
      select 书名,max(阅读时间) as 阅读时间 
      from table1 group by 书名) as b
     on a.书名=b.书名 and a.阅读时间=b.阅读时间
      

  2.   

    select max(序号),书名,max(阅读时间) from table1 group by 书名
      

  3.   

    select * 
    from table 
    where 书名,阅读时间
    in(
    select 书名,max(阅读时间) from table1 group by 书名
    )
      

  4.   

    谢谢各位大侠,真是sql高手多多啊!!感叹!!!!
      

  5.   

    SELECT DISTINCT 书名, MAX(阅读时间) AS 阅读时间
    FROM TATLE1
    GROUP BY 书名
      

  6.   

    select bookname,max(readdate) from teble1 group by bookname新手也写一个
      

  7.   

    应该是按书名的降序排列的把,没记错应该是这样:
    select distinct bookname from table order by bookname desc;
      

  8.   

    select * from table1 where 阅读时间 in(select max(阅读时间) from table1 group by 书名)
      

  9.   

    select *
    from table1 a
    where not exists (select 1 
                        from table1
                        where 书名 = a.书名
                              and 阅读时间 < a.阅读时间
                      )
    select *
    from table1 a
    where not exists (select 1 
                        from table1
                        where 书名 = a.书名
                              and 序号 < a.序号
                      )
      

  10.   

    to
     playyuer(退休干部 卧鼠藏虫)select 1 到底有啥作用,好象得到的全是1的记录
      

  11.   

    select *
    from table1 a
    where not exists (select 1 
                        from table1
                        where 书名 = a.书名
                              and 阅读时间 < a.阅读时间
                      )
    order by a.序号
      

  12.   

    高手好像写反了:
    select *
    from table1 a
    where not exists (select 1 
                        from table1
                        where 书名 = a.书名
                              and 阅读时间 > a.阅读时间
                      )
    select *
    from table1 a
    where not exists (select 1 
                        from table1
                        where 书名 = a.书名
                              and 序号 > a.序号
                      )
      

  13.   

    用得着这么麻烦么,select 序号,书名,max(阅读时间) from table1 group by 序号,书名
    这样写有什么问题么?