1、按照三个字段都符合条件来排序
ORDER BY
(
CASE
WHEN is_top = 1
AND top_end_time>UNIX_TIMESTAMP()
AND top_start_time<UNIX_TIMESTAMP() then
1
ELSE
2
END
),
sorts DESC,ct desc
wamptao 2018-07-19 17:07 原文
1、按照三个字段都符合条件来排序
ORDER BY
(
CASE
WHEN is_top = 1
AND top_end_time>UNIX_TIMESTAMP()
AND top_start_time<UNIX_TIMESTAMP() then
1
ELSE
2
END
),
sorts DESC,ct desc