tinyint默认值为0
时间: 2023-12-20 19:01:35 浏览: 230
destoon数据结构.doc
在MySQL中,tinyint默认值为0。当你执行insert语句向表A的列B插入数据时,如果你想让MySQL不报错,可以设置B列的默认值为0。这样,当你执行insert into A (B) values ('aaa')时,如果没有提供具体的值给B列,MySQL会自动将其设置为默认值0,从而避免报错。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [mysql怎么让字符串插入默认值为0的tinyint(1)字段中不出错](https://blog.csdn.net/weixin_33600816/article/details/113233656)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [数据库系统及应用教程-实验项目二、为数据库表添加约束](https://download.csdn.net/download/m0_62489881/85208023)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文