我的两张表是:
table User ( userid, username, ... )
table Bookings ( bookingid, userid, destination, ...)
我想列出那些有目的地=“希腊”的预订的用户的所有预订;
first match: (user name)
Destination: Greece ( = match criteria)
Destination: [other destinations from this user]
Destination: destionation n ...
second match: (user name)
Destination: Greece
Destionation: [other destionations]
[...]
我是更复杂的 SQL 的新手。我认为你需要一个子选择。但它是如何工作的?