我有3个Columns表,所有都是主键。
Table BId SId RId 5 30 5 5 30 12 5 30 15 5 30 20 10 30 4 10 30 5 10 30 7 10 30 12 12 30 4 12 30 5 17 30 5 17 30 7 74 30 5 74 30 7 Now I need to keep the rows unique and only with Value show below table should be Bid Sid Rid 5 30 15 10 30 15 12 30 15 17 30 15 74 30 15
答案 0 :(得分:2)
SELECT DISTINCT bid, sid, rid
FROM my_table
WHERE rid NOT IN (7, 15)