MySQL Forums
Forum List  »  Newbie

Re: Display Width Clarification (numeric data types)
Posted by: laptop alias
Date: August 15, 2009 05:59PM

I think it's only significant where padding is used:
mysql>create table intw(a smallint(2) zerofill,
    ->                          b smallint(9)zerofill) ;
Query OK, 0 rows affected (0.08 sec)

mysql> insert into intw values (1,1),(1234,1234), (32767,32767);
Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0

mysql> select * from intw;
+-------+-----------+
| a     | b         |
+-------+-----------+
|    01 | 000000001 |
|  1234 | 000001234 |
| 32767 | 000032767 |
+-------+-----------+
3 rows in set (0.00 sec)

Options: ReplyQuote


Subject
Written By
Posted
Re: Display Width Clarification (numeric data types)
August 15, 2009 05:59PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.