【MYSQL】【基础知识】【mysql联合主键如何 in查询】
1.mysql联合主键如何 in查询
SELECT * FROM `b_uu`
where user_key="1628740725993" and (code,sys_type) in(("Amazon","fba"),("Grand","ec"))
SELECT * FROM `b_uu`
where user_key="1628740725993" and (code,type) in(select code,sys_type from b_uu)
2.for update的使用及其注意点
只要在需要查询的sql后面加上for update,就能锁住查询的行,特别要注意查询条件必须要是索引列,
如果不是索引就会变成表锁,把整个表都锁住。