大家好我怎么能从一个表中删除一个查询中的2行。我的代码是:
DELETE FROM panel_friends
WHERE friends_friend_id = ' . $k . ' AND friends_member_id = ' . $key2
AND
WHERE friends_friend_id = ' . $k2 . ' AND friends_member_id = ' . $key
答案 0 :(得分:3)
DELETE
FROM panel_friends
WHERE (friends_friend_id = :k1 AND friends_member_id = :k2)
OR
(friends_friend_id = :k2 AND friends_member_id = :k1)