我婉通過UNION ALL在PHP
選擇從兩個表8列當我選擇3列,它的工作原理 但是當我的工作選擇4個或更多(像5,6,7,8),它不選擇3
SELECT ID , NULL AS Title , Who
FROM life
UNION ALL
SELECT ID , Title , NULL AS Who
FROM content
我的查詢工作
我的查詢中選擇更
SELECT ID , NULL AS Title , Who , MainImage , SubImage , NULL AS Place , ENDate , NULL AS Date
FROM life
UNION ALL
SELECT ID , Title , NULL AS Who , MainImage , SubImage , Place , ENDate , Date
From content
ORDER BY ENDate DESC
我嘗試這些但不是有效的
SELECT life.ID , NULL AS Title , life.Who
FROM life
UNION ALL
SELECT content.ID , content.Title , NULL AS Who
FROM content
這
SELECT life.ID , NULL AS Title , life.Who , life.MainImage , life.SubImage , NULL AS Place , life.ENDate , NULL AS Date
FROM life
UNION ALL
SELECT content.ID , content.Title , NULL AS Who , content.MainImage , content.SubImage , content.Place , content.ENDate , content.Date
From content
ORDER BY ENDate DESC
什麼是「不工作」呢? –
在頂部查詢中有'CONVERT(DATETIME,NULL)AS Date'嗎? – HoneyBadger