我的問題如下:ORDER BY子句不能與UNION工作的所有
SELECT title, 'dossier' as Source FROM dossier
UNION ALL
SELECT title, 'contract' as Source FROM contract ORDER BY `time` LIMIT 5
time
列存在兩個表中,但MySQL的引發以下錯誤:
unknown column 'time' in 'order clause'
當我刪除, 'dossier' as Source
和, 'contract' as Source
查詢工作正常。
請給作爲兩個表格的模式 – apomene