欢迎使用CSDN-markdown编辑器

来源:互联网 发布:js是什么端语言 编辑:程序博客网 时间:2024/06/07 07:15

MySql使用


新建表时添加自增字段(自增字段必须为Int型且不能为空)

create table 表名 (默认主键 int primary key, 自增字段 int auto_increment NOT NULL, KEY(自增字段));

数据查询

select * from 表名

清空数据表

  1. truncate table wp_comments;
  2. delete * from wp_comments;

设置某一个表字段为KEY

ALTER TABLE t_apply_approve ADD KEY(f_serial_number)

原创粉丝点击