select user_name from user1 where id in (select user_id from user_kills);
select * from user_kills;
select a.user_name from user1 a join user_kills b on a.id =b.user_id;
子查询和join之间的区别,如果当某条记录有重复的时候, 使用子查询,在不加distinct的条件下可以直接剔除重复。但是效率方面join和子查询谁更有效率。
select distinct a.user_name from user1 a join user_kills b on a.id =b.user_id;