以下是我的问题,如何在(?:...)
内获取topic_id = 27
?
另一个“新”主题,如cat_id = 2
感谢所有人,对不起我的不知情和我的英语: - )
ID = 24
答案 0 :(得分:0)
SQL查询
SELECT
categories.*,
(SELECT topics.topic_subject
FROM topics
WHERE topics.topic_cat = categories.cat_id
ORDER BY topics.topic_date DESC
LIMIT 1) AS category_last_subject
FROM
categories
ORDER BY
categories.cat_id DESC
LIMIT 5