1,删用户:
DELETE FROM user
WHERE id
IN (101915,101914)
2,查询全量发布小程序数:
SELECT * FROM wechat_micro_review
WHERE template_id
=462
3,查询审核成功的小程序数量
SELECT * FROM wechat_micro_review
WHERE template_id = '453' and status = 0 and publish_status = 0 order by status
SELECT * FROM wechat_micro_review
WHERE template_id
!=462 AND scene_code IN(1,2,3,4,5,6)
4,跨表查询
SELECT * FROM wechat_micro_review
WHERE biz_code
= (SELECT biz_code FROM wechat_open WHERE nick_name = '收银利器' and delete_mark = 0)
5,删除表1中含有表2id的数据
delete from 表1 where id in (select id from 表2)
6,删除表1中id和name同时等于表2的数据
delete from 表1 where exists (select 1 from 表2 where 表1.id=表2.id and 表1.name=表2.name);
6,更新表
UPDATE biz_property SET value= '0' WHERE p_key = 'is_show_flag' and biz_code = 'shop01CFUCRVNP'
7,新增字段(发布)
alter table wechat_micro_record_detail add column record_description varchar(100) not null default '0' comment '发布描述' after wechat_msg;
8,唯一字段设置
create unique index cms_category_title on cms_category(title);
9,复制并更新字段
INSERT INTO sys_menu(name,url,icon,delete_mark,delete_timestamp,gmt_created,gmt_modified) SELECT 'xixi',url,icon,delete_mark,delete_timestamp,gmt_created,gmt_modified from sys_menu where name = 'hehe';