×ðÁú¿­Ê±¹ÙÍøµÇ¼

oracleÖÐroundº¯ÊýµÄÓ÷¨

oracle ÖÐµÄ round º¯Êý¿É½«Êý×ÖÉáÈëµ½Ö¸¶¨¾«¶È£¬Ó﷨Ϊ£ºround(number, decimals)¡£ÆäÖУ¬number ΪҪÉáÈëµÄÊý×Ö£¬decimals ΪÉáÈëµÄ¾«¶È¡£Ê¾Àý£º½« 123.456 ÉáÈ뵽СÊýµãºóһλ£ºround(123.456, 1)£»ÉáÈ뵽СÊýµãºóÁ½Î»£ºround(123.456, 2)£»ÉáÈëµ½ÕûÊý£ºround(123.456, 0)¡£

Oracle ÖÐµÄ ROUND º¯Êý

ROUND º¯ÊýÓÃÓÚ½«Êý×ÖÉáÈëµ½Ö¸¶¨µÄ¾«¶È¡£ËüÓÐÒÔÏÂÓï·¨£º

ROUND(number, decimals)

µÇ¼ºó¸´ÖÆ

ÆäÖУº

number ÊÇÒªÉáÈëµÄÊý×Ö¡£

decimals ÊÇÒªÉáÈëµ½µÄ¾«¶È¡£

ʹÓÃʾÀý

ÒÔÏÂÊÇ ROUND º¯ÊýµÄһЩʹÓÃʾÀý£º

½« 123.456 ÉáÈ뵽СÊýµãºóһλ£º

SELECT ROUND(123.456, 1) FROM dual;

µÇ¼ºó¸´ÖÆ

Êä³ö£º

123.5

µÇ¼ºó¸´ÖÆ

½« 123.456 ÉáÈ뵽СÊýµãºóÁ½Î»£º

SELECT ROUND(123.456, 2) FROM dual;

µÇ¼ºó¸´ÖÆ

Êä³ö£º

123.46

µÇ¼ºó¸´ÖÆ

½« 123.456 ÉáÈëµ½ÕûÊý£º

SELECT ROUND(123.456, 0) FROM dual;

µÇ¼ºó¸´ÖÆ

Êä³ö£º

123

µÇ¼ºó¸´ÖÆ

×¢ÖØÊÂÏî

ÈôÊÇ decimals ΪÕýÊý£¬Ôòº¯Êý½«Êý×ÖÉáÈ뵽СÊýµãºóÖ¸¶¨µÄСÊýλÊý¡£

ÈôÊÇ decimals Ϊ¸ºÊý£¬Ôòº¯Êý½«Êý×ÖÉáÈ뵽СÊýµãÇ°Ö¸¶¨µÄСÊýλÊý¡£

ÈôÊÇ decimals Ϊ 0£¬Ôòº¯Êý½«Êý×ÖÉáÈëµ½×î¿¿½üµÄÕûÊý¡£

ÈôÊÇ number Ϊ NULL£¬Ôòº¯Êý·µ»Ø NULL¡£

ÒÔÉϾÍÊÇoracleÖÐroundº¯ÊýµÄÓ÷¨µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí£¬°æȨÕùÒéÓë±¾Õ¾Î޹أ¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È£¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ£¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢£¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢£¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎ壬9:30-18:30£¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ