开发者

MySQL OR question

Is there a way I can use the OR or something similar inside a join, inside the mysql code below.

INNER JOIN users_friends O开发者_如何转开发N users.user_id = users_friends.friend_id OR users_friends.user_id


INNER JOIN users_friends
    ON users.user_id IN (users_friends.friend_id, users_friends.user_id)


try:

INNER JOIN users_friends ON (users.user_id = users_friends.friend_id OR users_friends.user_id)


Don't you mean...

INNER JOIN users_friends ON (users.user_id = users_friends.friend_id OR
                             users.user_id = users_friends.user_id)


Used Many types of this query
INNER JOIN users_friends as U ON (users.user_id = U.friend_id OR U.user_id)


INNER JOIN users_friends ON (users.user_id = users_friends.friend_id || users.user_id = users_friends.user_id)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜