mysql修改最后一条记录&删除第一条记录

来源:互联网 发布:php 文件上传方法 编辑:程序博客网 时间:2024/05/01 18:09

//修改最后一条记录
UPDATE userinfo set userid='55' WHERE 1 ORDER BY userid DESC LIMIT 1
//删除第一条记录
delete from userinfo where 1 order by userid limit 1

mysql sql 修改表名 建立外键 修改列名 删除列 --重命名表
rename table t_softwareport to software_port;

--建立外键
alter table software_port add constraint fk_software_port_softwareprocessid foreign key (softwareprocessid)
      references software_process (id) on delete restrict on update restrict;

--删除列
alter table software_type
drop column upid,
drop column orderid;

--修改列名
alter table software_process change  software_id  softwareid  int(11) not null;

原创粉丝点击