如何查询数据库中一个时间列的最小值,以及查出这个列所在行的其他列的值?

解决方案 »

  1.   

    select min(时间列) from 表
    select * from 表 A where not exists(select 0 from 表 B where A.时间列>B.时间列)
    --或者
    select * from 表 where 时间列=(select min(时间列) from 表)
      

  2.   

    慢了,楼上正解
    select * from tb1 where 时间列=(select min(时间列) from tb1)
      

  3.   

    select * from 表 where 时间列=(select min(时间列) from 表)
      

  4.   

    select top 1 * from 表 order by 时间列
      

  5.   

    取值方法:
    http://topic.csdn.net/u/20080626/00/43d0d10c-28f1-418d-a05b-663880da278a.html
      

  6.   

    select top 1 * from 表 order by 时间列
      

  7.   

    select min(时间列) from 表 
    select * from 表 A where not exists(select 0 from 表 B where A.时间列>B.时间列) 
    --或者 
    select * from 表 where 时间列=(select min(时间列) from 表)