1 select……for update会锁表还是锁行?

如果查询条件用了索引/主键,那么select ….. for update就会进行行锁。
如果是普通字段(没有索引/主键),那么select ….. for update就会进行锁表。