Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

MySQL decimal ÀàÐÍ

      Ò»°ã¸³Ó踡µãÁеÄÖµ±»ËÄÉáÎåÈëµ½Õâ¸öÁÐËùÖ¸¶¨µÄÊ®½øÖÆÊý¡£Èç¹ûÔÚÒ»¸öFLOAT(8, 1)µÄÁÐÖд洢1. 2 3 4 5 6£¬Ôò½á¹ûΪ1. 2¡£Èç¹û½«ÏàͬµÄÖµ´æÈëFLOAT(8, 4) µÄÁÐÖУ¬Ôò½á¹ûΪ1. 2 3 4 6¡£Õâ±íʾӦ¸Ã¶¨Òå¾ßÓÐ×㹻λÊýµÄ¸¡µãÁÐÒÔ±ãµÃµ½¾¡¿ÉÄܾ«È·µÄÖµ¡£Èç¹ûÏ뾫ȷµ½Ç§·ÖÖ®Ò»£¬ÄǾͲ»Òª¶¨Òåʹ¸ÃÀàÐͽöÓÐÁ½Î»Ð¡Êý¡£
¡¡¡¡¸¡µãÖµµÄÕâÖÖ´¦ÀíÔÚMySQL3.23 ÖÐÓÐÀýÍ⣬FLOAT(4) ºÍFLOAT(8) µÄÐÔÄÜÓÐËù±ä»¯¡£ÕâÁ½ÖÖÀàÐÍÏÖÔÚΪµ¥¾«¶È£¨ 4 ×Ö½Ú£©ºÍË«¾«¶È£¨ 8 ×Ö½Ú£©µÄÀàÐÍ£¬ÔÚÆäÖµ°´¸ø³öµÄÐÎʽ´æ·Å£¨Ö»ÊÜÓ²¼þµÄÏÞÖÆ£©ÕâÒ»µãÉÏ˵£¬ÕâÁ½ÖÖÀàÐÍÊÇÕ渡µãÀàÐÍ¡£
¡¡¡¡DECIMAL ÀàÐͲ»Í¬ÓÚFLOATºÍDECIMAL£¬ÆäÖÐDECIMAL ʵ¼ÊÊÇÒÔ´®´æ·ÅµÄ¡£DECIMAL ¿ÉÄܵÄ×î´óÈ¡Öµ·¶Î§ÓëDOUBLE Ò»Ñù£¬µ«ÊÇÆäÓÐЧµÄÈ¡Öµ·¶Î§ÓÉM ºÍD µÄÖµ¾ö¶¨¡£Èç¹û¸Ä±äM ¶ø¹Ì¶¨D£¬ÔòÆäÈ¡Öµ·¶Î§½«ËæM µÄ±ä´ó¶ø±ä´ó¡£±í2 - 7µÄÇ°ÈýÐÐ˵Ã÷ÁËÕâÒ»µã¡£Èç¹û¹Ì¶¨M ¶ø¸Ä±äD£¬ÔòÆäÈ¡Öµ·¶Î§½«ËæD µÄ±ä´ó¶ø±äС£¨µ«¾«¶ÈÔö¼Ó£©¡£±í2 - 7µÄºóÈýÐÐ˵Ã÷ÁËÕâÒ»µã¡£
¡¡¡¡
¡¡¡¡¸ø¶¨µÄDECIMAL ÀàÐ͵ÄÈ¡Öµ·¶Î§È¡¾öÓÚMySQLµÄ°æ±¾¡£¶ÔÓÚMySQL3.23 ÒÔÇ°µÄ°æ±¾£¬DECIMAL(M, D) ÁеÄÿ¸öÖµÕ¼ÓÃM ×Ö½Ú£¬¶ø·ûºÅ£¨Èç¹ûÐèÒª£©ºÍСÊýµã°üÀ¨ÔÚM ×Ö½ÚÖС£Òò´Ë£¬ÀàÐÍΪDECIMAL(5, 2) µÄÁУ¬ÆäÈ¡Öµ·¶Î§Îª-9.99 µ½9 9 . 9 9£¬ÒòΪËüÃǸ²¸ÇÁËËùÓпÉÄܵÄ5 ¸ö×Ö·ûµÄÖµ¡£
¡¡¡¡ÕýÈçMySQL3.23 Ò»Ñù£¬DECIMAL ÖµÊǸù¾ÝANSI ¹æ·¶½øÐд¦ÀíµÄ£¬ ANSI ¹æ·¶¹æ¶¨DECIMAL(M, D) ±ØÐëÄܹ»±íʾM λÊý×Ö¼°D λСÊýµÄÈκÎÖµ¡£ÀýÈ磬 DECIMAL(5, 2) ±ØÐëÄܹ»±íʾ´Ó-999.99 µ½999.99 µÄËùÓÐÖµ¡£¶øÇÒ±ØÐë´æ´¢·ûºÅºÍСÊýµã£¬Òò´Ë×ÔMySQL3.23ÒÔÀ´DECIMAL ÖµÕ¼M + 2 ¸ö×Ö½Ú¡£¶ÔÓÚDECIMAL(5, 2)£¬“×”µÄÖµ£¨- 9 9 9 . 9 9£©ÐèÒª7¸ö×Ö½Ú¡£ÔÚÕýÈ¡Öµ·¶Î§µÄÒ»¶Ë£¬²»ÐèÒªÕýºÅ£¬Òò´ËMySQLÀûÓÃËüÀ©³äÁËÈ¡Öµ·¶Î§£¬Ê¹Æ䳬
¡¡¡¡¹ýÁËANSI Ëù¹æ·¶ËùÒªÇóµÄÈ¡Öµ·¶Î§¡£ÈçDECIMAL(5, 2) µÄ×î´óֵΪ9 9 9 9 . 9 9£¬ÒòΪÓÐ7 ¸ö×Ö½Ú¿ÉÓá£
¡¡¡¡¼ò¶øÑÔÖ®£¬ÔÚMySQL3.23 ¼°ÒÔºóµÄ°æ±¾ÖУ¬DECIMAL(M, D) µÄÈ¡Öµ·¶Î§µÈÓÚ¸üÔç°æ±¾ÖеÄDECIMAL(M + 2, D) µÄÈ¡Öµ·¶Î§¡£ÔÚMySQLµÄËùÓа汾ÖУ¬Èç¹ûij¸öDECIMAL ÁеÄD Ϊ0£¬Ôò²»´æ´¢Ð¡Êýµã¡£ÕâÑù×öµÄ½á¹ûÊÇÀ©³äÁËÁеÄÈ¡Öµ·¶Î§£¬ÒòΪ¹ýÈ¥ÓÃÀ´´æ´¢Ð¡ÊýµãµÄ×Ö½ÚÏÖÔÚ¿ÉÓÃÀ´´æ·ÅÆäËûÊý×ÖÁË¡£
±¾ÎÄÀ´×ÔCSDN²©¿Í£¬×ªÔØÇë±êÃ÷³ö´¦£ºhttp://blog.csdn.net/stefenjun/archive/2008/11/05/3224311.aspx


Ïà¹ØÎĵµ£º

mysql ÓÃͬһ±íÖеÄÁíÒ»ÐмǼµÄ×ֶθ³Öµ

CREATE TABLE `user` (
  `db_id` varchar(255) NOT NULL,
  `name` varchar(45) default NULL,
  `age` int(10) unsigned NOT NULL,
  `address` varchar(45) default NULL,
  PRIMARY KEY  (`db_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
// ÉèÖÃname='888'µÄageµÈÓÚname='111' ......

mysql µ¼Èë¡¢µ¼³öÊý¾Ý¿â¡¢±í

DOS¡¡´°¿Ú
¿ªÊ¼£­£¾ÔËÐУ­£¾¡¡cmd
µ¼³öΪ£º¡¡mysqldump -u Óû§Ãû -p  --opt  Êý¾Ý¿âÓû§Ãû >
Êý¾Ý¿âÃû.sql
ÊäÈëÄãµÄÊý¾Ý¿âÃÜÂë!phpma.com
µ¼ÈëΪ£ºmysql -u Óû§Ãû -p Êý¾Ý¿âÓû§Ãû < Êý¾Ý¿âÃû.sql
£¨Òª
ÔÚµ±Ç°Ä¿Â¼Ï²Ù×÷£©
ÒªÏ뽫Îı¾Îļþ

pet.txt

×°Ôص½
pet
±íÖУ¬Ê¹Ó ......

MYSQL³õѧÕßʹÓÃÖ¸ÄÏ

http://www.chinalinuxpub.com/read.php?wid=45
ÓкܶàÅóÓÑËäÈ»°²×°ºÃÁËmysqlµ«È´²»ÖªÈçºÎʹÓÃËü¡£ÔÚÕâƪÎÄÕÂÖÐÎÒÃǾʹÓÁ¬½ÓMYSQL¡¢ÐÞ¸ÄÃÜÂë¡¢Ôö¼ÓÓû§µÈ·½ÃæÀ´Ñ§Ï°Ò»Ð©MYSQLµÄ³£ÓÃÃüÁî¡£
Ò»¡¢Á¬½ÓMYSQL¡£
¸ñʽ£º mysql -hÖ÷»úµØÖ· -uÓû§Ãû £­pÓû§ÃÜÂë
1¡¢Àý1£ºÁ¬½Óµ½±¾»úÉϵÄMYSQL¡£
Ê×ÏÈÔÚ´ò¿ªDOS´°¿Ú£¬È»ºó½øÈëÄ¿ ......

MYSQL Ë«»úÈȱ¸ÅäÖÃÊÖ²á()


[Ô­´´] MYSQL Ë«»úÈȱ¸ÅäÖÃÊÖ²á[Ô­´´]
http://www.chinaunix.net ×÷Õß:squall1  ·¢±íÓÚ£º2007-07-23 19:01:43
¡¾·¢±íÆÀÂÛ¡¿¡¾²é¿´Ô­ÎÄ¡¿¡¾´æ´¢±¸·ÝÖ®¼ÒÌÖÂÛÇø¡¿¡¾¹Ø±Õ¡¿
×÷ÕߣºCU-squall   
·¢±íÓÚ£º2005Äê4ÔÂ18ÈÕ 8:21  ¿ÉÒÔ²»¾­×÷ÕßͬÒâ×ÔÓÉ´«²¥£¬Çë×¢Ã÷×÷Õß³ö´¦¡£
ʹ ......

PHP»·¾³ IIS+PHP+MYSQL»·¾³µÄ¼ÜÉè

ºÜ¾ÃûÓÐЩһЩÓÐÓô¦µÄµÄ¶«Î÷ÁË£¡½ñÌì¾Í²»ºúÂÒµÄ䶫Î÷ÁË!дһЩÓÐÓõģ¡µ±È»Ç°ÌáÏÂÊǺܸÐлºÜ¶à¾­³£À´ÎÒ²©¿ÍµÄÅóÓÑһϣ¡¶àл´ó¼Ò£¡£¡£¡£¡£¡
½ñÌìдµÄÊǹØÓÚphp»·¾³¼ÜÉèµÄµÚÒ»ÖÖ·½Ê½£¡µ±È»ÎҾͲ»½ØͼÁË£¡´ó¼ÒÖ»Òª°´ÕÕ²Ù×÷¾Í¿ÉÒÔʵÏֵģ¡
Ò»¡¢°²×° PHP £º±¾ÎÄPHP°²×°Â·¾¶È¡ÎªD:\php\php4\(Ϊ±Ü»ìÏý£¬PHP5.1.x°æ±¾°²×°Â·¾ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ