我查看了类似的问题,但没有找到正确的语法。
我有这些表:
报价 - quote_id - author_id - quote_ENG
作者 - author_id - 作者
TopicMap - topicmap_id - topic_ENG
QuotesByTopic - quote_id - topicmap_id
我需要从表 Quotes 中获取 'quote_ENG',从表 Authors WHERE 'topic_ENG'='age' 中获取 'author'。
我能够得到'quote_ENG'值......:
SELECT quote_ENG
FROM Quotes, TopicMap, QuotesByTopic
WHERE TopicMap.topics_ENG='age'
and QuotesByTopic.topicmap_id = TopicMap.topicmap_id
and QuotesByTopic.quotes_id = Quotes.quotes_id
...但我错过了最后一段获得“作者”价值的文章:
SELECT author, quote_ENG
FROM Authors, Quotes, TopicMap, QuotesByTopic
WHERE TopicMap.topics_ENG = 'age'
and Authors.author_id = Quotes.author_id
and QuotesByTopic.topicmap_id = TopicMap.topicmap_id
and QuotesByTopic.quotes_id = Quotes.quotes_id
感谢您的任何帮助