Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想查询 2 个表。
以下是表结构:
常问问题
faq_id | member_id | answer
工人
id | faq_id | owner1 | owner2
我在这里尝试做的是:
SELECT faqs.*, workbasket.* FROM faqs INNER JOIN workbasket WHERE faqs.member_id = 1 AND workbasekt.owner1 = 1 OR workbasekt.owner2 = 1
像这样的东西?
SELECT FAQ.*, workers.* FROM FAQ INNER JOIN workers on FAQ.faq_id = workers.faq_id WHERE FAQ.member_id = 1 AND (workers.owner1 = 1 OR workers.owner2 = 1)
您需要更具描述性并解释您想要返回哪些列、您想要从哪些表中获取信息,以及这些表应该如何连接在一起。