#1305 - 功能n.DATE_FORMAT不存在
选择 n.title, g.title, DATE_FORMAT(FROM_UNIXTIME(n.data),'%d')天 来自新闻n 内部联接( SELECT COUNT(id_news)_COUNT,DATE_FORMAT(FROM_UNIXTIME(data),'%d')_day FROM news GROUP BY _day)as n2
ON n2._day = n.DATE_FORMAT(FROM_UNIXTIME(n.data),'%d')
INNER JOIN group
请参阅group_id
= n。id_group
GROUP BY DATE_FORMAT(FROM_UNIXTIME(n.data),'%d')
答案 0 :(得分:1)
1.您无法在ON Clause
SELECT
n.title,
g.title,
DATE_FORMAT(FROM_UNIXTIME(n.data), '%d') day
FROM news as n
INNER JOIN(
SELECT COUNT(id_news) _COUNT ,DATE_FORMAT(FROM_UNIXTIME(data), '%d') _day FROM news GROUP BY _day) as n2
ON n2._day= n.DATE_FORMAT(FROM_UNIXTIME(n.data), '%d')
INNER JOIN `group` AS g ON g.`group_id`=n.`id_group`
GROUP BY DATE_FORMAT(FROM_UNIXTIME(n.data), '%d')