MySQL 单行多记录
我有一个表,其中包含多行,这些行定义了特定度假村的“设施”。如果有包含我定义的“amenOptionID”的行,我需要返回resortID。我的问题在于我想看看度假村是否有两个或更多设施。例如:
我想返回同时具有 amenOptionID 1 和 4 的 ResortID。我也不想要重复的 ResortID。表结构请参阅图片。预先感谢您的任何帮助。
I have a table with contains multiple rows that define "amenities" for a particular resort. I need to return the resortID if there are rows containing whatever "amenOptionID" I define. My issue comes in where I'm looking to see if a resort has two or more amenities. For example:
I want to return resortIDs that have BOTH amenOptionID 1 AND 4. I also do not want duplicate resortIDs. Refer to the image for the table structure. Thanks in advance for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为这会起作用...
I think this will work...