oracleÖÐ(+µÄÓ÷¨
oracle ÖмӺÅ(+)ÔËËã·û¿ÉÓÃÓÚ£ºÅþÁ¬×Ö·û´®¡¢Êý×Ö¡¢ÈÕÆÚºÍʱ¼ä¾àÀ룻´¦Àí null Öµ£¬½« null ת»»Îª·Ç null Öµ£»×ª»»Êý¾ÝÀàÐÍΪ×Ö·û´®ÀàÐÍ¡£
Oracle ÖмӺÅ(+)ÔËËã·ûÓ÷¨
Oracle ÖеļӺÅ(+)ÔËËã·û¾ßÓжàÖÖÓÃ;£¬°üÀ¨£º
1. ÅþÁ¬×Ö·û´®
SELECT 'Hello' || ' World'; -- Êä³ö£ºHelloWorld
µÇ¼ºó¸´ÖÆ
2. ÅþÁ¬Êý×Ö
SELECT 12 + 34; -- Êä³ö£º46
µÇ¼ºó¸´ÖÆ
3. ÅþÁ¬ÈÕÆÚ
SELECT DATE '2023-01-01' + INTERVAL '1' DAY; -- Êä³ö£º2023-01-02
µÇ¼ºó¸´ÖÆ
4. ÅþÁ¬Ê±¼ä¾àÀë
SELECT INTERVAL '1' HOUR + INTERVAL '30' MINUTE; -- Êä³ö£ºINTERVAL '1:30' HOUR TO MINUTE
µÇ¼ºó¸´ÖÆ
5. NULL ´¦Àí
¼ÓºÅ(+)ÔËËã·û¿ÉÒÔ½« NULL ֵת»»Îª·Ç NULL Öµ£¬ÏêϸÈçÏ£º
×Ö·û´®£º NULL + ×Ö·û´® = ×Ö·û´®
Êý×Ö£º NULL + Êý×Ö = Êý×Ö
ÈÕÆÚ£º NULL + ÈÕÆÚ = ÈÕÆÚ
ʱ¼ä¾àÀ룺 NULL + ʱ¼ä¾àÀë = ʱ¼ä¾àÀë
SELECT NULL + 'Hello'; -- Êä³ö£ºHello SELECT NULL + 12; -- Êä³ö£º12
µÇ¼ºó¸´ÖÆ
6. ת»»Êý¾ÝÀàÐÍ
¼ÓºÅ(+)ÔËËã·û¿ÉÒÔ½«Êý¾ÝÀàÐÍÒþʽת»»Îª×Ö·û´®ÀàÐÍ¡£
SELECT '12' + 34; -- Êä³ö£º'1234'
µÇ¼ºó¸´ÖÆ
×¢ÖØ£º
¼ÓºÅ(+)ÔËËã·ûÓÅÏȼ¶¸ßÓڳ˺Å(*)ºÍ³ýºÅ(/)¡£
¹ØÓÚ¿ÕÖµ»ò NULL Öµ£¬¼ÓºÅ(+)ÔËËã·ûµÄÐÐΪ×ñÕÕ Oracle µÄ¿ÕÖµ´¦Àí¹æÔò¡£
ÒÔÉϾÍÊÇoracleÖÐ(+µÄÓ÷¨µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡