-2
我有新聞表,新聞中有4個類別,我想獲得每個類別的最新消息(按日期排序)。我用了以下查詢:爲什麼順序不通過組合?
SELECT node.nid AS nid,
term_data.tid AS term_data_tid,
node.type AS node_type,
node.vid AS node_vid,
node.title AS node_title,
node_data_field_blog_overview.field_blog_overview_value AS node_data_field_blog_overview_field_blog_overview_value,
node_data_field_blog_overview.field_blog_overview_format AS node_data_field_blog_overview_field_blog_overview_format,
term_data.name AS term_data_name,
term_data.vid AS term_data_vid,
users.name AS users_name,
users.uid AS users_uid,
node.created AS node_created,
node_data_field_blog_overview.field_feed_author_name_value AS node_data_field_blog_overview_field_feed_author_name_value,
node.sticky AS node_sticky
FROM node node
LEFT JOIN term_node term_node ON node.vid = term_node.vid
LEFT JOIN term_data term_data ON term_node.tid = term_data.tid
LEFT JOIN content_field_image node_data_field_image ON node.vid = node_data_field_image.vid
LEFT JOIN content_type_blog node_data_field_blog_overview ON node.vid = node_data_field_blog_overview.vid
INNER JOIN users users ON node.uid = users.uid
WHERE (node.type in ('blog')) AND (node.status <> 0)
GROUP BY term_data_name order by node_created
LIMIT 5
爲什麼我沒有得到每個類別的最新消息使用上述查詢?
你想說什麼嗎? – user1336827
我越來越舊的消息 – Akki
我得到與desc和asc – Akki