我有 3 个表希望能够在视图中组合:
tblContent:
strTitle | txtContent
content 1 title | content 1 content
content 2 title | content 2 content
content 3 title | content 3 content
tblNews
news_title | news_content
news 1 title | news 1 content
news 2 title | news 2 content
tblTradeMembers
company_title | company_content
trade 1 title | trade 1 content
trade 2 title | trade 2 content
trade 3 title | trade 3 content
trade 4 title | trade 4 content
所以基本上,我想将这些表中的每一个的内容映射到我的单个结果视图,然后我可以查询如下:
title | content | from
content 1 title | content 1 content | tblContent
content 2 title | content 2 content | tblContent
content 3 title | content 3 content | tblContent
news 1 title | news 1 content | tblNews
news 2 title | news 2 content | tblNews
trade 1 title | trade 1 content | tblTradeMembers
trade 2 title | trade 2 content | tblTradeMembers
trade 3 title | trade 3 content | tblTradeMembers
trade 4 title | trade 4 content | tblTradeMembers
所以我可以这样做:
select * from custom_view WHERE content LIKE "%3%"
这是可以实现的,我该怎么做?