这是正常排序情况:
以下是查找上一篇的sql:
SELECT * FROM
article WHERE sort >= 0 AND time >= '2020-10-25 14:15:56' ORDER BY sort DESC,time DESC;
得到结果正确 如下显示:
附上表sql结构 如下:
INSERT INTO
cs_test.
article (
id,
title,
content,
sort,
time`) VALUES ('1', '标题一', '内容1', '0', '2020-10-25 14:14:28');
INSERT INTO cs_test
.article
(id
, title
, content
, sort
, time
) VALUES ('2', '标题二', '内容2', '0', '2020-10-25 14:14:56');
INSERT INTO cs_test
.article
(id
, title
, content
, sort
, time
) VALUES ('3', '标题三', '内容3', '1', '2020-10-25 14:13:20');
INSERT INTO cs_test
.article
(id
, title
, content
, sort
, time
) VALUES ('4', '标题四', '内容4', '0', '2020-10-25 14:15:54');
INSERT INTO cs_test
.article
(id
, title
, content
, sort
, time
) VALUES ('5', '标题五', '内容5', '0', '2020-10-25 14:15:56');`
求大神指教!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…