尊龙凯时人生就是搏

sqlÖÐroundµÄ×÷ÓÃ

round º¯ÊýÓÃÓÚ½«Êý×ÖËÄÉáÎåÈëµ½Ö¸¶¨µÄСÊýλÊý £¬Ó﷨Ϊ round(number, decimals)¡£Æä×÷ÓðüÀ¨ÃûÌû¯Êý×Ö¡¢Æ¾Ö¤¾«¶ÈÅÌËãºÍ½¨ÉèÖ¸¶¨Ð¡ÊýλÊýµÄÅÉÉúÁС£

SQL ÖÐ ROUND º¯ÊýµÄ×÷ÓÃ

ROUND º¯ÊýÓÃÓÚ½«Ö¸¶¨Ãü×ÖËÄÉáÎåÈëµ½Ö¸¶¨µÄСÊýλÊý¡£Ëü½ÓÊÜÁ½¸ö²ÎÊý£ºÒªËÄÉáÎåÈëµÄÊý×ÖºÍÄ¿µÄСÊýλÊý¡£

Óï·¨

ROUND(number, decimals)

µÇ¼ºó¸´ÖÆ

²ÎÊý

number£ºÒªËÄÉáÎåÈëµÄÊý×Ö»ò±í´ïʽ¡£

decimals£ºÒªËÄÉáÎåÈëµ½µÄÄ¿µÄСÊýλÊý¡£¿ÉÒÔÊÇÕýÕûÊý»ò¸ºÕûÊý¡£

ËÄÉáÎåÈë¹æÔò

ÈôÊÇСÊý²¿·ÖΪ 0.5 »ò¸ü´ó £¬ÔòÊý×Ö½«ÏòÉÏËÄÉáÎåÈë¡£

ÈôÊÇСÊý²¿·ÖСÓÚ 0.5 £¬ÔòÊý×Ö½«ÏòÏÂËÄÉáÎåÈë¡£

ÈôÊÇÄ¿µÄСÊýλÊýΪ¸ºÊý £¬Ôòº¯Êý½«É¾³ý±ÈÖ¸¶¨Î»Êý¸ü¶àµÄÊý×Ö¡£

ʾÀý

ÏÂÃæÊÇһЩËÄÉáÎåÈëµÄʾÀý£º

ÊäÈë decimals Êä³ö
12.345 0 12
12.345 1 12.3
12.345 2 12.35
12.345 -1 10

ÓÃ;

ROUND º¯ÊýÆÕ±éÓÃÓÚÒÔϳ¡¾°£º

ÃûÌû¯Êý×ÖÒÔ¾ÙÐÐÏÔʾ¡£

ƾָ֤¶¨¾«¶È¾ÙÐÐÅÌËã¡£

½¨Éè¾ßÓÐÌض¨Ð¡ÊýλÊýµÄÅÉÉúÁС£

×¢ÖØ

decimals ²ÎÊý¿ÉÒÔ°üÀ¨Ð¡Êý £¬ÔÊÐí¸ü׼ȷµÄËÄÉáÎåÈë¡£

ROUND º¯Êý²»»á¸Ä±äÊäÈëÊý×ÖµÄÏÖʵֵ £¬ËüÖ»»á·µ»ØËÄÉáÎåÈëºóµÄÖµ¡£

¹ØÓÚÐèÒª¸üÖØ´óµÄÉáÈë¹æÔòµÄÇéÐÎ £¬Çë˼Á¿Ê¹ÓÃÆäËûº¯Êý £¬Èç CEILING »ò FLOOR¡£

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

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

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

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

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

QR code
sitemap¡¢ÍøÕ¾µØͼ