sqlServer,oracleÖÐcase¹Ø¼ü×ÖµÄÓ÷¨
ÔÚдSQLʱ£¬ÓÐʱҪ¸ù¾ÝÒÑÓеÄÁÐÖµ¹¹ÔìеÄÁÐÖµ£¬Õâʱ¾ÍÒªÓõ½µÄSQLÖеÄcase¹Ø¼ü×Ö¡£ÈçÏÂËùʾ²éѯ¸ºÔðÈËÐÅÏ¢±í£¨T_MS_CustomerCrmInfoDutyPerson£©ÖеÄÊÇ·ñÊÇÖ÷Òª¸ºÔðÈË£¨isMainDuty£©×ֶΣ¬µ«ÊÇÕâ¸ö×ֶεÄÖµÊÇÒÔö¾ÙµÄ·½Ê½´æ´¢µÄ£¬´æ´¢0±íʾÊÇ·ñ£¬1±íʾÊÇ£¬·ñÔò±íʾδÅжϡ£Õâʱֱ½Ó²éѯ³öµÄÖµ²»ÊÇ×Ô¼ºÐèÒªµÄÖµ£¬¿ÉÒÔÓÃcase¹Ø¼ü×ÖÖØй¹½¨ÁÐÖµ¡£
select case
when cfdutystate=0 then '·ñ'
when cfdutystate=1 then 'ÊÇ'
else null
end as isMainDuty
from T_MS_CustomerCrmInfoDutyPerson
×¢Òâµã£º
1£¬ÒÔcase¿ªÍ·£¬ÒÔend½áβ
2£¬whenºó¸úÌõ¼þ·ÖÖ§ÖУ¬thenºóΪÏÔʾ½á¹û
3£¬elseΪ³ý´ËÖ®ÍâµÄĬÈÏÇé¿ö£¬ÀàËÆÓÚjavaµÄswitch caseµÄdefault£¬¿ÉÒÔ²»¼Ó
4£¬OracleÖÐendºó¸ú±ðÃû»òÕßsqlserverÖÐÓï·¨ÈçÏ£º
isMainDuty =case
when cfdutystate=0 then '·ñ'
when cfdutystate=1 then 'ÊÇ'
else null
end
³ý´ËÖ®Í⣬caseÒ²¿ÉÒÔÓõ½group byÓï¾äÖÐÒÔ¸ù¾ÝÐèҪʵÏÖÁé»îµÄ·Ö×é²Ù×÷£¬ÈçÏÂËùʾµÄÁÐ×Ó:
SELECT
CASE
WHEN price IS NULL THEN 'Unpriced'
WHEN price < 10 THEN 'Bargain'
WHEN price BETWEEN 10 and 20 THEN 'Average'
ELSE 'Gift to impress relatives'
&n
Ïà¹ØÎĵµ£º
truncate,delete,dropµÄÒìͬµã
×¢Òâ:ÕâÀï˵µÄdeleteÊÇÖ¸²»´øwhere×Ó¾äµÄdeleteÓï¾ä
Ïàͬµã:truncateºÍ²»´øwhere×Ó¾äµÄdelete, ÒÔ¼°drop¶¼»áɾ³ý±íÄÚµÄÊý¾Ý
²»Í¬µã:
1. truncateºÍ deleteֻɾ³ýÊý¾Ý²»É¾³ý±íµÄ½á¹¹(¶¨Òå)
dropÓï¾ä½«É¾³ý±íµÄ½á¹¹±»ÒÀÀµµÄÔ¼Êø(constrain),´¥·¢Æ÷(trigger),Ë÷Òý(index); ÒÀÀµÓÚ¸Ã±íµ ......
Á¬½ÓOracleÊý¾Ý¿âµÄHibernateÅäÖÃÎļþ
Á¬½ÓOracleµÄHibernateÅäÖÃÎļþÓÐÁ½ÖÖ¸ñʽ£¬Ò»ÖÖÊÇxml¸ñʽµÄ£¬ÁíÒ»ÖÖÊÇJavaÊôÐÔÎļþ¸ñʽµÄ¡£ÏÂÃæ·Ö±ð¸ø³öÕâÁ½ÖÖ¸ñʽÅäÖÃÎļþµÄ´úÂë¡£
1£®xml¸ñʽµÄÅäÖÃÎļþ
ÏÂÃ潫¸ø³öÁ¬½Ó±¾µØOracle·þÎñÆ÷ÉϵÄdb_database02Êý¾Ý¿âʱHibernateÅäÖÃÎļþhibernate.cfg.xmlµÄ´úÂë¡£
Àý³Ì2-5£º¹âÅÌ\mr ......
ÒòΪ¹«Ë¾µÄÕÆÉϳÇÊÐϵͳÔÚ¶à¸öµØÊÆͬʱÉÏÏߣ¬¶øΪÁËÈÃÿ¸ö³ÇÊеÄ3G¿ìѶ¾ßÓеØÊÆÌØÉ«ÐÔ£¬Ã¿¸öµØÊÆÓÐ×Ô¼ºµ¥¶ÀµÄÊý¾Ý¿âϵͳ£¬¶øÿ¸öµØÊƵĿìѶÓÖһЩ¹²Í¬µÄ£¬Æ©ÈçͻȻ³öÁËÒ»Ìõ¹ú¼ÊÐÂÎÅ£¬ÄÇôÊDz»ÊÇÿ¸öµØÊƵĺǫ́±à¼¶¼ÒªÂ¼ÈëÒ»±é£¬ÕâÑùÎÞÒÉÊÇ×öÁËÐí¶àÎÞÓù¦£¬ËùÒÔ¹«Ë¾¿¼ÂǼÜÉèÒ»¸ö×ÜÕ¾£¬×ÜÕ¾ÉÏÓÐרÃŵÄÈ˸ºÔð£¬Ã¿Ì츺Ôð¼ÈëÒ» ......
ORACLEʵÀýÓÐϵͳȫ¾ÖÇø£¨SGA£©ºÍһЩºǫ́½ø³Ì×é³É.
ϵͳȫ¾ÖÇø£¨SGA£©Óй²Ïí³Ø£¨shared pool£©,Êý¾Ý¿â¸ßËÙ»º³åÇø£¨database buffer cache£©,ÖØ×öÈÕÖ¾»º³åÇø£¨redo log buffer£©.¹²Ïí³ØÓÖÓпâ¸ßËÙ»º´æ£¨library cache£©ºÍÊý¾Ý×Öµä¸ßËÙ»º´æ£¨dictionary cache£©×é³É¡£
ORACLE ʵÀý5¸ö±ØÐèµÄºǫ́½ø³Ì£ºSMON,PMON,DBWR,LGWR, ......
oracle Êý¾ÝÀàÐÍÏê½â---ÈÕÆÚÐÍ
oracleÊý¾ÝÀàÐÍ¿´ÆðÀ´·Ç³£¼òµ¥£¬µ«ÓÃÆðÀ´»á·¢ÏÖÓÐÐí¶à֪ʶµã£¬±¾ÎÄÊÇÎÒ¶ÔORACLEÈÕÆÚÊý¾ÝÀàÐ͵ÄһЩÕûÀí£¬¶¼ÊÇ¿ª·¢ÈëÃÅ×ÊÁÏ£¬Óë´ó¼Ò·ÖÏí£º
×¢£ºÓÉÓÚINTERVAL¼°TIME ZONEʵ¼ÊÓõñȽÏÉÙ£¬ËùÒÔ±¾ÎÄÄÚÈÝδÉæ¼°ÕâÁ½¸ö·½Ãæ¡£
1¡¢³£ÓÃÈÕÆÚÐÍÊý¾ÝÀàÐÍ
1.1¡¢DATE
......