21,882
社区成员
发帖
与我相关
我的任务
分享
SELECT *
FROM `table`
WHERE pub_time < ".time()."
ORDER BY istop DESC, pub_time DESC
Update table set pub_time = NULL where UNIX_TIMESTAMP() > pub_time;
SELECT * FROM `table` ORDER BY pub_time desc,istop DESC;
Update table set pub_time = NULL where pub_time > UNIX_TIMESTAMP();
SELECT * FROM `table` ORDER BY pub_time desc,istop DESC;
select * from 'table' where istop>0 and pubtime>time() order by istop desc,pubtime desc
union all
select * from 'table' where istop<0 order by pubtime desc
不知道你的置顶帖子和不置顶的帖子是怎么区分的?istop>0或者istop<0是区分是否置顶帖子。