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