是否有人可以幫助我在一個SQL查詢,其中有這樣一個表作爲的SQLite刪除一組,其中{A,B}和{B,A}
Col A | Col B
-------------
A B
C D
E F
B A
我怎麼刪除{B,A}或者選擇{B,A}
的問題是:
If two students A and B are friends, and A likes B but not vice-versa,
remove the Likes tuple.
我想通了其中A和B是朋友和A喜歡B中的表,但我不知道如何刪除在B喜歡元組
我
select friend.id1, friend.id2
from friend, likes
where friend.id1 = likes.id1 and friend.id2 = likes.id2
你給出的表格結構類似於表格或freinds表格,如果它像表格那麼按照你的問題'A喜歡B而不是反之,'A喜歡B但不喜歡A'然後' {B,A}'不應該被移除,但是{C,D},{E,F}'... – sourcecode