我有一个朋友表,其中包含这样的列:
requester_user_id //the user initiating the request
requested_user_id //the user responding to the request
established //bool, true is 'these two are friends'
我还有其他一些专栏,但它们对于这个问题并不重要。
我需要的是一个查询,它将获取您所有朋友 ID 的列表。问题是,您的 ID 可能在请求者或请求者中,具体取决于发起请求的人。
我觉得必须有一个简单的方法,但如果不做多个if
s 我就无法弄清楚。