文章詳情頁
mysql - sql union 之后的結果與其他表join?
瀏覽:68日期:2022-06-15 16:59:37
問題描述
sql1:
select id,name from table1;
sql2:
select id,name from table2;
union 合并表
select id,name from table1 union select id,name from table2;
如何將union合并后的結果變成一張新表再與其他表進行join
如:
select * from (select id,name from table1 union select id,name from table2) aleft join (select id,name from table3) b on a.id = b.id;
問題解答
回答1:可以嘗試下臨時表、表變量;你最后這個應該也可以吧
相關文章:
1. docker-compose中volumes的問題2. 微信開放平臺 - ios APP能不能打開微信然后通過微信跳轉到指定的URL?3. php - mysql 模糊搜索問題4. angular.js - 百度支持_escaped_fragment_嗎?5. mysql begin work語句是干嘛的?6. 新手 - Python 爬蟲 問題 求助7. vim - win10無法打開markdown編輯器8. php mail無法發送郵件9. thinkphp5.1學習時遇到session問題10. python - 用scrapy-splash爬取網站 為啥iframe下的內容沒有被返回
排行榜
