比如说电商中的商品表,普遍会有一个库存字段,根据常识来看,库存字段不会为负数。

限制字段不能负数应该如下操作(设置无符号):

 

alter table product_sku modify stock int(11) unsigned default 0 not null comment '库存';

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2021-10-11
  • 2022-12-23
相关资源
相似解决方案