Mysql---经常会用到的SQL语句
最近在开发一些项目,对于处理大数据,通常会用到一些SQL语句来帮助我们快速处理数据,下面就列举常见用到的一些SQL语句:
1、批量修改某个字段:
update school_score set major_id=0;
2、修改表名
alter table wlkj_file rename to wlkj_admin_file;
3、设置某个字段
update wlkj_admin_areas set subname = name; update wlkj_admin_areas set subname = name where status = 1;
4、简单的where查询
select * from wlkj_admin_areas where status = 1;
5、设置日期为时间戳
update wlkj_record set finished_ats = unix_timestamp(finished_at);
多个条件:
SELECT * FROM `wlkj_data_plan` WHERE schoolid=1 AND year=2021;
持续更新...
打完收工!