oracleÖÐTranslate()º¯ÊýÓ÷¨
Ò»¡¢Óï·¨£º
TRANSLATE(string,from_str,to_str)
¶þ¡¢Ä¿µÄ
·µ»Ø½«£¨ËùÓгöÏֵģ©from_strÖеÄÿ¸ö×Ö·ûÌæ»»Îªto_strÖеÄÏàÓ¦×Ö·ûÒÔºóµÄstring¡£TRANSLATEÊÇREPLACEËùÌṩµÄ¹¦ÄܵÄÒ»¸ö³¬¼¯¡£Èç¹ûfrom_str±È to_str³¤£¬ÄÇôÔÚfrom_strÖжø²»ÔÚto_strÖеĶîÍâ×Ö·û½«´ÓstringÖб»É¾³ý£¬ÒòΪËüÃÇûÓÐÏàÓ¦µÄÌæ»»×Ö·û¡£to_str²»ÄÜΪ¿Õ,Oracle½«¿Õ×Ö·û´®½âÊÍΪNULL£¬²¢ÇÒÈç¹ûTRANSLATEÖеÄÈκβÎÊýΪNULL£¬ÄÇô½á¹ûÒ²ÊÇNULL¡£
Èý¡¢ÔÊÐíʹÓõÄλÖÃ
¹ý³ÌÐÔÓï¾äºÍSQLÓï¾ä¡£
ËÄ¡¢Ê¾Àý
SELECT TRANSLATE('abcdefghij','abcdef','123456') from dual;
TRANSLATE
--------------
123456ghij
SELECT TRANSLATE('abcdefghij','abcdefghij','123456') from dual;
TRANSLATE
--------------
123456
select translate('smaspalae','as','s') from dual;
TRANSLATE
--------------
mspslse
select translate('smaspalae','s','as') from dual;
TRANSLATE
--------------
amaapalae
¿ÉÒÔ½«from_strÓëto_strÖеÄÿһ¸ö×Ö·û¶ÔÓ¦ÆðÀ´£¬ÓÃto_str×Ö·ûÈ¥Ìæ»»stringÖÐfrom_str¶ÔÓ¦µÄ×Ö·û£¬
ÀýÈçtranslate('smaspalae','as','s')ÓÃto_strÖеÄ's'È¥Ìæ»»'smaspalae'ÖÐfrom_str¶ÔÓ¦µÄ×Ö·û'a'£¬
to_strÖÐûÓÐ×Ö·ûÓëfrom_strÖÐ's'¶ÔÓ¦£¬¿ÉÒÔÀí½âΪto_str
Ïà¹ØÎĵµ£º
oracle±í¿Õ¼ä²Ù×÷Ïê½â
1
2
3×÷Õߣº À´Ô´£º ¸üÐÂÈÕÆÚ£º2006-01-04
5
6
7½¨Á¢±í¿Õ¼ä
8
9CREATE TABLESPACE data01
10DATAFILE '/ora ......
ѧϰOracle DBAÒ²°ë¸ö¶àѧÆÚÁË£¬½ñÌìÃÍÈ»²Å·¢ÏÖ£¬ÔÀ´ÎÒµÄÊ黹ÊǺÜеģ¬ÉϿβÙ×÷ʱºòÒ²Ö»ÊÇÖªµÀ´ó¸ÅÔõô×ö£¬µ«ÊÇÒªÕæµÄÈ«²¿×Ô¼º×ö£¬¶ø²»È¥·Ê黹ÊÇÓÐÒ»¶¨µÄÄѶȵģ¬ËùÒÔÄØ£¬½ñÌ쿪ʼ½«DBA´ÓÍ·¸´Ï°Ò»±é£¬Í¬Ê±ÔÙ²Ù×÷Ò»±é¡£
µÚÒ»Õ£¬Ñ§µÄÊÇOracleµÄÌåϵ½á¹¹£ ......
´¥·¢Æ÷¿ª·¢µÄÄ¿µÄ£ºÈ·±£Êý¾Ý¿âÂú×ãÌØ¶¨µÄÉÌÒµ¹æÔòºÍÆóÒµÂß¼£¬¿ÉÒÔʹÓô¥·¢Æ÷£¬Ô¼Êø£¬×Ó³ÌÐò¡£ÒòΪ
Ô¼Êø×î¼òµ¥ÇÒÐÔÄܺã¬ËùÑ¡Ô¼Êø£¬Èç¹ûÔ¼Êø²»ÄÜÂú×㣬¾ÍÓô¥·¢Æ÷£¬Èô´¥·¢Æ÷¶¼²»ÄÜÂú×ãÑ¡Ôñ×Ó³ÌÐò¡£
Ò»¡¢´¥·¢Æ÷¹¦ÄÜ£º
1£¬¿ØÖÆÊý¾Ý°²È«,ÔÚ·þÎñÆ÷¼¶±ð¿ØÖÆÊý¾Ý ......
ÔÎĵØÖ·£ºhttp://www.cnblogs.com/yf520gn/archive/2009/01/12/1374359.html
EXISTSµÄÖ´ÐÐÁ÷³Ì
select * from t1 where exists ( select null from t2 where y = x )
¿ÉÒÔÀí½âΪ:
for x in ( select * from t1 )
loop
if ( exists ( select null from ......
1¡¢Ê¹ÓÃ%TYPE
ÔÚÐí¶àÇé¿öÏ£¬PL/SQL±äÁ¿¿ÉÒÔÓÃÀ´´æ´¢ÔÚÊý¾Ý¿â±íÖеÄÊý¾Ý¡£ÔÚÕâÖÖÇé¿öÏ£¬±äÁ¿Ó¦¸ÃÓµÓÐÓë±íÁÐÏàͬµÄÀàÐÍ¡£ÀýÈ磬students±íµÄfirst_nameÁеÄÀàÐÍΪVARCHAR2(20),ÎÒÃÇ¿ÉÒÔ°´ÕÕÏÂÊö·½Ê½ÉùÃ÷Ò»¸ö±äÁ¿
DECLARE
v_FirstName VARCHAR2(20);
µ«ÊÇÈç¹ûfirst_nameÁе͍Òå¸Ä±äÁ˻ᷢÉúʲô£¨±ÈÈç˵±í¸Ä±äÁË£¬first ......