【发布时间】:2015-07-19 13:31:51
【问题描述】:
我的工会声明似乎有效:
SELECT q.id, q.hits, q.type, q.title, q.date, q.author, q.wfurl
FROM (SELECT id AS id, hits AS hits, type AS type, title AS title, date AS date, author AS author, wfurl AS wfurl, status AS status
FROM articles WHERE status = 1
UNION SELECT id, hits, type, title, published, author_id, url, status
FROM new_articles WHERE status = 1) AS q
GROUP BY q.id
我正在尝试按ORDER BY type 的类型订购整个东西,但无论我把它放在哪里似乎都会引发错误。我把它放在第一行,在 AS 之后和两个选择里面,没有运气。
【问题讨论】:
标签: mysql sql sql-order-by union