通过好友关系表 获取我的好友

来源:互联网 发布:网络技术学院 编辑:程序博客网 时间:2024/04/29 08:09

 

select a.* from yin_view_user_info a
inner join (
select   case userid  when 1 then FriendId else UserID END as FriendId from yin_friend_link_info
where userid=1 or friendid=1  ) friend_table on a.userid=FriendId

原创粉丝点击