select * from t where the_date = 
( select max(the_date)
  from t 
 where rec_date <= '参数日期' )

解决方案 »

  1.   

    select * from tablename where abs(to_number(to_char(datecol,'yyyymmdd'))-to_number(参数))=(select min(abs(to_number(to_char(datecol,'yyyymmdd'))-to_number(参数))) from tablename )
      

  2.   

    第二不是已经答了吗
    select datefield from tableName
    where datefield = 
         (select max(datefield) from tableName
          where dtordered <= to_date('2005-2-9','yyyy-mm-dd'))其中datefield是日期字段,tableName是表名,自己改一下
      

  3.   

    zhpsam109(孤寂无边) 所说就可以实现
      

  4.   

    像二楼的那样简单,
    select datefield from tableName
    where datefield = 
         (select max(datefield) from tableName
          where dtordered <= to_date('2005-2-9','yyyy-mm-dd'))
      

  5.   

    select max(进货日期) from table where 进货日期 <= to_date('&"查询日期(yyyy-mm-dd)"','yyyy-mm-dd'))
      

  6.   

    select min(datefield) from tableName
    where to_date('2005-3-9','yyyy-mm-dd')-datefield>=0;
      或
    select * from tableName,(select min(datefield) as df from tableName where to_date('2005-3-9','yyyy-mm-dd')-datefield>=0) where datefield=df;