以下sql有什么问题?我根本不知道
SELECT `posts`.*
FROM `posts`
WHERE ((`posts`.`featured` = 1 OR `posts`.`author_id` = 5))
ORDER BY (ln( 1 + posts.likes_count) +
(EXTRACT(EPOCH FROM posts.created_at) -
1327654606)/9000) desc LIMIT 15
感谢
答案 0 :(得分:2)
EPOCH
在MySQL中无效。尝试替换
EXTRACT(EPOCH FROM posts.created_at)
与
UNIX_TIMESTAMP(posts.created_at)
获取自posts.created_at
以来1970-01-01 00:00:00
的秒数。