Reputation: 2789
I want to execute this kind of a query:
SELECT 00005
Now its result showing as 5. It not taking '0000'. How to get the correct value. Any body can help me.
Upvotes: 1
Views: 216
Reputation: 122032
You can set a ZEROFILL property, e.g. -
CREATE TABLE table1(
column1 INT(5) UNSIGNED ZEROFILL DEFAULT NULL
);
SELECT * FROM table1;
+---------+
| column1 |
+---------+
| 00005 |
| 00025 |
+---------+
Upvotes: 1