首页  >  文章  >  数据库  >  mysql的sql经典写法收录_MySQL

mysql的sql经典写法收录_MySQL

WBOY
WBOY原创
2016-05-27 13:46:21984浏览

表关联更新:

 

UPDATE user_bank a INNER JOIN bank AS b

ON a.bank_code = b.bank_code

SET a.bank_type =b.id WHERE a.bank_type IS NULL AND a.id=1650;

 

更新前的查询:

 

select * from user_bank where id = 1650;

select * from user_bank where bank_type is null;

select count(*) from user_bank where bank_type is null;

select * from bank;

select * from bank where bank_code = '03010000';

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn