我正在尝试获取不同人食用的水果清单。
+-----------+
ID Name
+----+------+
1 Paul
2 John
3 Nick
+----+------+
Table: users
+--------+--------+
userID Fruit
+--------+--------+
1 Apple
2 Peach
2 Orange
2 Apple
3 Apple
3 Peach
+--------+--------+
Table: eats
现在我可以很容易地得到谁吃了什么的清单。但是如果我想知道谁吃了第二个水果?结果将是:
+--------+----------+
Name Fruit
+--------+----------+
John Orange
Nick Peach
+--------+----------+
Result
SELECT Name, Fruit FROM users, eats WHERE ID = userID ... ???