DB2??ORACLE??SQLд???????????
???????????? ???????[ 2016/6/12 14:26:19 ] ????????????? SQL Server
??????????ORACLE?????????????????????е?SQL????????ORACLE???????????????ANSI????SQL????????????3?????????ORACLE??????????У?????????hibernate?????У????????????
????DB2????????????????????????500?80%??DB2???100?????????? ??DB2?????????????????У?????С???????????????????????????DB2????????ò???????ORACLE??????????д????“ORACLE ?????”????????????????ú????????????????????????????????????б?????ο???ò???????????Щ???????????????????
????1?????????????????
????2??Where???????????ж?
????oracle: where ???????? in (????) ???????DB2??????
????select 'abc' from dual where '1' in (1) ??oracle??????
????select 'abc' from sysibm.sysdummy1 where '1' in (1) ??DB2?±???
????oracle??where ????????=????????? ?????DB2??????
????select 'abc' from dual where '1'=1 ??oracle??????
????select 'abc' from sysibm.sysdummy1 whre '1'=1 ??DB2?±???
????3??replace?????
????oracle????DB2????? create or replace?????DB2????????
????4??????????
????ORACLE ???select * from(select 1 from dual) ???? select * from(select 1 from dual) t
????DB2 ???select * from(select 1 from sysibm.sysdummy1) t ???? select * from(select 1 from sysibm.sysdummy1) as t
??????????д????select * from(????) t
????5??DATE?????????????
????ORACLE??DATE?????????????????DB2??DATE????????????'2007-04-28'?????????????????????DB2?????????????????TIMESTAMP??
???????????hibernate????????????????
????????????????ж????????????Date??
????<property name="createTime" type="java.util.Date" >
????<column name="CREATE_TIME" length="7" />
????</property>
????????DB2?£?????α??????timestamp????????????DATE??????????????????????
????????DB2??????????????п???????????????????????????????ε???????? where create_date = '2007-04-26' ??where create_timestamp = '2007-04-26 08:08:08' ??????????????????????
????6??????????
???????????JDBC???????????rownum??DB2?в????????????masa_area???????area_idС??10???????????????£????????????t??д????
????ORACLE: select t.* from (select rownum as r1 ??masa_area.* from masa_area order by area_id) t where t.r1<=10
????DB2: select t.* from (select rownumber() over() as r1 ??masa_area.* from masa_area order by area_id) t where t.r1<=10
????7??decode????
????decode??????DB2?????????????д???????case when
????8??NVL????
????nvlд????DB2?????????????д???????coalesce
????ORACLE: select NVL(f_areaid??'??') from masa_user ????? select coalesce(f_areaid??'??'??f_areaid) from masa_user
????DB2: select coalesce(f_areaid??'??'??f_areaid) from masa_user
????9??substr????
????DB2 substr???????£?
????masa_group???f_groupCode??ζ????VARCHAR(100)???????????????????????????substr(f_groupCode??1??101)??????
????select * from masa_group where substr(f_groupCode??1??50) = '001006' order by f_groupcode
??????DB2??????????
????select * from masa_group where substr('001006'?? 1?? 50) = '001006' order by f_groupcode
????????????????????????
???????????'001006'????????????????6??charater??
????????ORACLE?к????????????
??????????????λ??????λ???????????????????????
????ORACLE??select substr('123456'??1) from dual
????DB2??select substr('123456'??1) from sysibm.sysdummy1
?????????????
????10??????????????????
????ORACLE Sysdate
????DB2 CURRENT DATE
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11