????Oracle???????MySQL????????????????????????????????????????????????????
????1.???????÷?????
????mysql???麯????select????п???????????????oracle????????????????麯?????????????????????麯????????????????group by????е??з?????
????eg??
????select name??count(money) from user?????????mysql???????????oracle???????????
????2.????????????????????
????MYSQL??????????????????????????????ò???????Σ????????????????ORACLE???????????????????????????????????????????к???????????????к???????????????Ρ?
????CREATE SEQUENCE???к??????(???????+???к???)INCREMENT BY 1 START WITH 1 MAXVALUE 99999 CYCLE NOCACHE;
???????д???????ε??????????????????????????????к?NUMBER(6)??????999999
????INSERT???????????????????к??????.NEXTVAL
????3.??????????
????MYSQL??????????????????????ORACLE?????????????????????????????????????????????????????滻???????г??????????????滻?????????????
????4.?????SQL???????
????MYSQL????????SQL??????????LIMIT???λ????????????PHP????????SEEK??λ?????????λ?á?ORACLE????????SQL?????????????????????????ROWNUM??α???????λ????????????ROWNUM<100????????ROWNUM>80??
??????????????????????????ORACLE???SQL???(ID????????????)??
??????????
????SELECT ID?? [FIELD_NAME??...] FROM TABLE_NAME WHERE ID IN ( SELECT ID FROM (SELECT ROWNUM AS NUMROW?? ID FROM TABLE_NAME WHERE ????1 ORDER BY ????2) WHERE NUMROW > 80 AND NUMROW < 100 ) ORDER BY ????3;
??????????
????SELECT * FROM (( SELECT ROWNUM AS NUMROW?? c.* from (select [FIELD_NAME??...] FROM TABLE_NAME WHERE ????1 ORDER BY ????2) c) WHERE NUMROW > 80 AND NUMROW < 100 ) ORDER BY ????3;
????5.????????????
????????????????ORACLE??????????????INSERT??UPDATE??????????????????С?????4000?????????????????????????????????????CLOB?????????????ORACLE???????DBMS_LOB??????????????????????????з???????ж??????????????????????????????????????棬??????β?????
????6.??????ε????
????MYSQL??????η?DATE??TIME?????ORACLE??????????DATE??????????????????????????????????????SYSDATE??????????????????????????????????TO_DATE(‘2001-08-01’??’YYYY-MM-DD’)??-??-??24С?:????:?????YYYY-MM-DD HH24:MI:SS TO_DATE()???к????????????????ο?ORACLE DOC.???????????????????????TO_CHAR(‘2001-08-01’??’YYYY-MM-DD HH24:MI:SS’)
??????????ε??????????к???????MYSQL?????????7????DATE_FIELD_NAME > SUBDATE(NOW()??INTERVAL 7 DAY)ORACLE?????????7???? DATE_FIELD_NAME >SYSDATE - 7;
????MYSQL?в??????????????????NOW()??????`'YYYY-MM-DD HH:MM:SS'??????????????????????浽DATETIME????С?CURDATE()??’YYYY-MM-DD’?????????????????????浽DATE????С?CURTIME()??’HH:MM:SS’??????????????????????浽TIME????С?????insert into tablename (fieldname) values (now())
??????oracle?е???????sysdate
????7.??????????
????MYSQL?????????п???????ORACLE??????????β??????п?????????MYSQL??NOT NULL??????ORACLE????????????????????????????????????????????ж??????NULL????????????????????????????????
????8.?????????????
????MYSQL?????????like%‘?????%’??ORACLE??????????????like%‘?????%’?????????????????????????????????????????instr(???????‘?????’)>0??????????????????
????9.??????????????????????????????????????????????