select * from tba where textdate=()
不使用子查询如何实现?

解决方案 »

  1.   

    select * from tba a
    where textdate<sysdate
      and not exists(select 1 from tba
        where textdate<sysdate
          and textdate>a.textdate)
      

  2.   

    select * from tba where textdate < sysdate and rownum = 1 order by textdate desc
      

  3.   

    如果为左关联呢!left join tba on tba.id=table.id and tba.textdate=()
      

  4.   

    left join tba a on a.id=table.id 
      and a.textdate <sysdate 
      and not exists(select 1 from tba 
        where textdate <sysdate 
          and textdate>a.textdate) 
      

  5.   

    可是这样的话最后面得那个a.textdate无法识别啊!他不人a这个别名啊!
      

  6.   

    left join tba a on a.id=table.id 
      and a.textdate <sysdate 
      and not exists(select 1 from tba 
        where textdate <sysdate 
          and textdate>a.textdate) 
      

  7.   

    会说a.textdate是无效的标识符!~