SELECT user_profile_data.*
FROM relation_table,user_profile_data
WHERE user_profile_data.ref_user_id=relation_table.user2
and relation_table.type = 1
AND relation_table.user1 = 184
ORDER BY user_profile_data.full_name ASC
我有这个查询,它产生这里显示的结果表:- http://sqlfiddle.com/#!2/340f0/1
FULL_NAME LOCATION REF_USER_ID
Fake IN 181
Fake gupta IN 185
Fake kumar IN 182
Fake sharma IN 183
Fakeme IN 180
Manish Kumawat US 192
现在我想修改我的查询,以便获得 id=182 的“Fake Kumar”之后的结果,如下所示:-
FULL_NAME LOCATION REF_USER_ID
Fake sharma IN 183
Fakeme IN 180
Manish Kumawat US 192
user_profile_data.full_name>'Fake Kumar'
由于某些安全问题,我不能使用我可以使用的是 id 但如果我使用我user_profile_data.ref_user_id>182
会得到如下结果:-
FULL_NAME LOCATION REF_USER_ID
Fake gupta IN 185
Fake sharma IN 183
Manish Kumawat US 192
我应该使用什么查询来获得所需的结果