mysql

根据一个字段更新另外一个字段  ,批量更新 

update pathology_bill t1,customer_payment t2 set t1.payment_status = t2.payment_status where t1.customer_payment_id = t2.id;

SELECT payment_status  from pathology_bill where customer_payment_id is not null;

 

 

对比2个表的差异数据 
SELECT * FROM (
SELECT * FROM sys_menu_li UNION ALL SELECT * FROM sys_menu_chen
) t
GROUP BY `menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`
HAVING COUNT(*) = 1 ORDER BY menu_id

posted @ 2022-09-28 16:14  Verite  阅读(5)  评论(0编辑  收藏  举报