MySQL使用某一条件查询出的数据和另以表中数据进行left jion连接

版权声明:本文为作者原创,转载请注明出处。 https://blog.csdn.net/vop444/article/details/82913359
SELECT
user_id,
user_name
 FROM
tik_groups_user as a
 LEFT JOIN tik_user as b ON a.user_id = b.id
 WHERE
   a.user_id IN(
     SELECT
    user_id
     FROM
    tik_groups_user
     WHERE
    groups_id = #{groupsId}
)
 ORDER BY a.groups_id

 

展开阅读全文

没有更多推荐了,返回首页