熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Oracle >> 正文

Oracle三層嵌套查詢

2022-06-13   來源: Oracle 

  String sql=select oa_attinfoatt_startstateoa_attinfoatt_endstate+

  oa_useruser_realnameoa_deptdept_nameoa_attendtimeatt_starthour+

  oa_attendtimeatt_startminoa_attendtimeatt_endhour+

  oa_attendtimeatt_endmin from oa_attinfooa_user+

  oa_deptoa_attendtime where to_char(oa_attinfoatt_timeYYYYMMDD)=+

  year++strmonth++strdate+ and oa_attinfoatt_user=+

  user+ and oa_attinfoatt_user=oa_useruser_number and +

  oa_userdept_number=oa_deptdept_number;

  其中的 oa_attinfo oa_useroa_dept為表名

  select * from account where rowid in(select rid from (select rownum rnrid from(select rowid ridcreate_date from

  account order by create_date desc) where rownum<) where rn>) order by create_date desc;


From:http://tw.wingwit.com/Article/program/Oracle/201311/18721.html
  • 上一篇文章:

  • 下一篇文章:
  • 推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.