如何从四个表中获取数据?
我有四张桌子:
- Article_Table (
ArticleName, ArticleNumber
) - IndexDetails_Table (
IndexSubMasterId, ArticleNumber
) - IndexSubMaster_Table (
IndexSubMasterId, IndexMasterId
) - IndexMaster_Table (
IndexMasterId, Keyword
)
我需要最终输出:
ArticleName from Article table.
我将为您提供一个Keyword
作为输入参数。
我需要的过程是:
IndexMasterId From IndexMaster_Table where Keyword = 'bl'
IndexSubMasterId From IndexSubMaster_Table
Where IndexSubMaster_Table.IndexMasterId = IndexMaster_Table.IndexMasterIdArticleNumber From IndexDetails_Table Where IndexDetails_Table.IndexSubMasterId = IndexSubMaster_Table.IndexSubMasterId
ArticleName From Article_Table
Where Article_Table.ArticleNumber = IndexDetails_Table.ArticleNumber