从某张表里取一条数据 条件是它的创建时间最早 条件怎么写

解决方案 »

  1.   

    select * from table where createtime=(select min(createtime) from table)
      

  2.   

    select * 
    from tb t1
    where not exists(select 1 from tb t2 where t1.ctime>t2.ctime)
      

  3.   


    select * from table 
    where createtime=(
        select min(createtime) 
        from table where colName = 'colValue'
    ) and colName = 'colValue'
      

  4.   


    select * from table where createtime=(select min(createtime) from table)
      

  5.   

    select * 
    from tb t1
    where not exists(select 1 from tb t2 where t1.ctime>t2.ctime)
      

  6.   

    select * from table_name where createtime in (select min(createtime) from table_name)
      

  7.   

    createtime 有吗
    select * from table_name where rowid = (select min(rowid) from table_name)
    rowid 不知道行不行