mysql-zerofill关键字
时间:2021-07-01 10:21:17
帮助过:29人阅读
create table shop(
-> article
int(
4) unsigned zerofill
default ‘0000‘ not null,
-> dealer
char(
20)
default ‘‘ not null,
-> price
double(
16,
2)
default ‘0.00‘ not null,
-> primary key(article,dealer));
mysql> insert into shop
values(
1,
‘A‘,
3.45),(
1,
‘B‘,
3.99),(
2,
‘A‘,
10.99),(
3,
‘B‘,
1.4
5),(
3,
‘C‘,
1.69),(
3,
‘D‘,
1.25),(
4,
‘D‘,
19.95);
Query OK, 7 rows affected (
0.01 sec)
Records: 7 Duplicates:
0 Warnings:
0
mysql> select * from shop;
+---------+--------+-------+
| article
| dealer
| price
|
+---------+--------+-------+
| 0001 | A
| 3.45 |
| 0001 | B
| 3.99 |
| 0002 | A
| 10.99 |
mysql-zerofill关键字
标签:cat article create primary 0.00 sel 1.2 3.4 col