摘要:
自增列必须是主键吗 不一定的,MySQL 每张表只能有1个自动增长字段,这个自动增长字段即可作为主键,也可以用作非主键使用,但是请注意将自动增长字段当做非主键使用时必须必须为其添加唯一索引,否则系统将会报错。例如: 将自动增长字段设置为主键。 create table t1 (id int auto 阅读全文
摘要:
创建存储过程 delimiter && create procedure pro_name (in id int, out count_num int) reads sql date begin select count(*) from t_book where book_type = id; en 阅读全文