Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

mysql ÓëOracle º¯Êý¶Ô±È

Oracleº¯ÊýºÍmysqlº¯Êý±È½Ï
1.       OracleÖеÄto_number()ת»»³ÉÊý×Ö£»
Oracle> Select to_number(‘123’) from dual;  -----         123;
              select to_char(33) from dual;----                      33;
Mysql> Select conv(‘123’,10,10); ----                123;
           Select cast(‘123’ as signed integer);---    123
          Select cast(‘-123’ as signed integer);---   -123
          select cast(33 as char(2) ); -------            33£»
          select char(33);--------------------              !;(ascll)
¶ÔÓ¦µÄmysqlº¯ÊýÊÇconv(N,from_base,to_base)£¬ÔÚ²»Í¬µÄÊý×Ö»ùÖ®¼ä±ä»»Êý×Ö¡£·µ»ØÊý×ÖNµÄ×Ö·û´®Êý×Ö£¬´Ófrom_base»ù±ä»»Îªto_base»ù£¬Èç¹ûÈκβÎÊýÊÇNULL£¬·µ»ØNULL¡£²ÎÊýN½âÊÍΪһ¸öÕûÊý£¬µ«ÊÇ¿ÉÒÔÖ¸¶¨ÎªÒ»¸öÕûÊý»òÒ»¸ö×Ö·û´®¡£×îС»ùÊÇ2ÇÒ×î´óµÄ»ùÊÇ36¡£Èç¹ûto_baseÊÇÒ»¸ö¸ºÊý£¬N±»ÈÏΪÊÇÒ»¸öÓзûºÅÊý£¬·ñÔò£¬N±»µ±×÷ÎÞ·ûºÅÊý¡£   CONVÒÔ64λµã¾«¶È¹¤×÷¡£
castÖеÄsigned±íʾÓзûºÅÊý£»
 
2.       ËÄÉáÎåÈ뺯ÊýÇø±ð
Oracle> select floor(12.89*10)/10 from dual;--12.8
          select ceil(12.82*10)/10 from dual;--12.9
          select round(12.86*10)/10 from dual;--12.9
      select round(12.84*10)/10 from dual;--12.8
mysql>


Ïà¹ØÎĵµ£º

Struts2+Spring+HibernateÁ¬½ÓmysqlÖÐÎÄÂÒÂë½â¾ö

1.struts.xmlÖÐÉèÖÃ
<constant name="struts.il8n.encoding" value="UTF-8"></constant>
2.jspÒ³ÃæÉèÖÃ
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
3.Êý¾Ý¿âÁ¬½Óurl
jdbc:mysql://localhost:3306/test?useUnicode=true&amp;characterEncoding=u ......

ʹMySQL rootÕË»§ÄÜÔ¶³Ì·ÃÎÊ

1.µÇ¼MySQLÖÕ¶Ë 2.ÊÚȨ:
ÔÊÐíËùÓлúÆ÷·ÃÎÊMySQL·þÎñÆ÷
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH RIVILEGES;
ÔÊÐíÖ¸¶¨»úÆ÷·ÃÎÊMySQL·þÎñÆ÷
GRANT ALL PRIVILEGES ON *.* TO 'root'@'IPµØÖ·'IDENTIFIED BY 'password' WITH GRANT OPTION; ......

[ת]mysqlÖÐdata_format()

DATE_FORMAT(date,format)
¸ù¾Ýformat×Ö·û´®¸ñʽ»¯dateÖµ¡£ÏÂÁÐÐÞÊηû¿ÉÒÔ±»ÓÃÔÚformat×Ö·û´®ÖУº %M ÔÂÃû×Ö(January……December)
%W ÐÇÆÚÃû×Ö(Sunday……Saturday)
%D ÓÐÓ¢Óïǰ׺µÄÔ·ݵÄÈÕÆÚ(1st, 2nd, 3rd, µÈµÈ¡££©
%Y Äê, Êý×Ö, 4 λ
%y Äê, Êý×Ö, 2 λ
%a ËõдµÄÐÇÆÚÃû×Ö(Sun&h ......

Çë×¢ÒâMYSQLÓï¾äÖеÄÒýºÅ

SQL #1: select * from uchome_feed where uid in('0',501...) order by dateline desc limit 0,50;
SQL #2: select * from uchome_feed where uid in(0,501...) order by dateline desc limit 0,50;
SQL #1  ÊÇCSDN ¸öÈË¿Õ¼ä»ñÈ¡¸öÈ˶¯Ì¬µÄSQL£¬ÊôUCHÔ­°æSQL¡£
SQL #2 ÊÇÈ¥µôµ¥ÒýºÅ(SQL #1ÖкìÉ«²¿·Ö)ºóµÄSQL£¬Á½¸ ......

MySQL´æ´¢ÒýÇæºÍ±íÀàÐÍ·ÖÎö

 ºÃ¾ÃûÓÐÕûÀí¶«Î÷£¬¸Ð¾õ×Ô¼ºÔ½À´Ô½ÀÁ£¬ÕýºÃ½üÆÚÓиöMYSQLµÄÏîÄ¿£¨Ò»¸öORACLEµÄÓ¦ÓÃǨÒƵ½MYSQL£©£¬ÒÔǰûÓнӴ¥¹ýMYSQL£¬µ«ÊÇÒ²ÖªµÀMYSQLÊý¾Ý¿âÄ¿Ç°¹ã·ºµÄÓ¦ÓÃÔÚ¸÷ÖÖ¸öÈË¡¢ÉÌÎñϵͳÖУ¬¸÷ÖÖ¼¼Êõ¶¼±È½Ï³ÉÊì¡£°Ñ×Ô¼ºÑ§Ï°µÄһЩ¹ý³Ì×ܽáһϣ¬¸ÃÎÄÕÂÉè¼Æµ½µÄÄÚÈݶ¼Ã»ÓÐ×öÌ«ÏêϸµÄ²ûÊö£¬Ö»ÊÇÒ»¸ö¼òµ¥µÄÈëÃÅÊֲᡣ
  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ