我有两个表USER和Relation_User如何获取列出我想要关注的所有用户的信息,而这些用户已经没有关注我
User Table
Usid|name
---------
1 | Jack
2 | Bla
3 | Havi
4 | Tri
Relation_User
Rid|usid|fusid
--------------
1 | 1 | 2
2 | 2 | 1
3 | 3 | 2
4 | 1 | 4
select usid, name from user u
where u.usid <> @id and u.usid not in (
select distinct fusid from relation_user where usid = @id
)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句