| | |
use of mysql unsigned ?
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
The best I can gather from the documentation is that "signed" or "unsigned" refers to the plus or minus sign a person would traditionally use to indicate a positive or negative value. So an UNSIGNED numeric value can never be negative.
Therefore, if you have a column that you want to contain a numeric value, but never hold a negative value, I guess you could apply the UNSIGNED modifier to the data type.
http://dev.mysql.com/doc/refman/5.0/...-overview.html
Therefore, if you have a column that you want to contain a numeric value, but never hold a negative value, I guess you could apply the UNSIGNED modifier to the data type.
http://dev.mysql.com/doc/refman/5.0/...-overview.html
the biggest difference is an unsigned number cannot be negative (just as stated above)
but the benefit of usign an unsigned number is that you can have a greater range of positive numbers.
Tinyint: The signed range is -128 to 127. The unsigned range is 0 to 255.
Mediumint: The signed range is -8388608 to 8388607. The unsigned range is 0 to 16777215.
Bigint: The signed range is -9223372036854775808 to 9223372036854775807. The unsigned range is 0 to 18446744073709551615.
you get the point from there, a great use of unsigned numbers is for any column that has an auto_increment flag on it, since it will never be negative
but the benefit of usign an unsigned number is that you can have a greater range of positive numbers.
Tinyint: The signed range is -128 to 127. The unsigned range is 0 to 255.
Mediumint: The signed range is -8388608 to 8388607. The unsigned range is 0 to 16777215.
Bigint: The signed range is -9223372036854775808 to 9223372036854775807. The unsigned range is 0 to 18446744073709551615.
you get the point from there, a great use of unsigned numbers is for any column that has an auto_increment flag on it, since it will never be negative
![]() |
Similar Threads
- updating records using php and mysql (PHP)
- Help With Messages in Mysql Stop Overwriting (MySQL)
- SQL Server vs MYSQL vs MSQL (i'm stopping now) (MS SQL)
Other Threads in the MySQL Forum
- Previous Thread: Search facility for a drop down box
- Next Thread: project stuff
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner gnu government gpl greenit groupware hiring hyperic images innerjoins insert ip joebrockmeier join keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization





