Oracle 可以这样实现﹕
Select * from user.bsempms where rownum<=n;
DB2 可以这样实现﹕
Select * from DB2admin.bsempms fetch first n rows only;
另外也可以用 row_number() over() 去实现的;
Oracle 可以这样实现﹕
Select sysdate from dual;
DB2 可以这样实现﹕
Select current timestamp from sysibm.sysdummy1;
Oracle 可以这样实现﹕
Select emp_no||emp_nam from bsempms;
Select concat(emp_no,emp_nam) from bsempms;
DB2 可以这样实现﹕
Select emp_no||emp_nam from DB2admin.bsempms;
select emp_no concat emp_nam from DB2admin.bsempms;
Oracle 可以这样实现﹕
Select sysdate from dual;
DB2 可以这样实现﹕
Select current timestamp from sysibm.sysdummy1;
Oracle可以这样实现﹕ Select a.* from bsempms a,bsdptms b where a.dpt_no=b.dpt_no; DB2 可以这样实现﹕ Select * from DB2admin.bsempms inner join DB2admin.bsdptms on DB2admin.bsempms.dpt_no=DB2admin.bsdptms.dpt_no;
6.外连接的Oracle和DB2的写法(右外连接,左外连接,完全外连接,组合外连接)
Oracle可以这样实现﹕
Select a.* from bsempms a,bsdptms b where a.dpt_no=b.dpt_no(+);
Select a.* from bsempms a,bsdptms b wherea.dpt_no(+)=b.dpt_no;
DB2 可以这样实现﹕
Select * from DB2admin.bsempms right outer join DB2admin.bsdptms
on DB2admin.bsempms.dpt_no=DB2admin.bsdptms.dpt_no;
Select * from DB2admin.bsempms left outer join DB2admin.bsdptms
on DB2admin.bsempms.dpt_no=DB2admin.bsdptms.dpt_no;
Select * from DB2admin.bsempms full outer join DB2admin.bsdptms
on DB2admin.bsempms.dpt_no=DB2admin.bsdptms.dpt_no;
Oracle 可以这样实现﹕
SQL>@$PATH/filename.sql;
DB2 可以这样实现﹕
DB2 -tvf $PATH/filename.sql 文件中每行以 ; 结尾。