There are two sorting fields, the update time: upTime release time: After the addTime article is published, there will be its release time. If you modify the article, a modification time will be saved. Sort data on the homepage according to the following rules: 1. If an article with an update time uses upTime, only the published time uses ad..., there are two sorting fields,
Update Time: upTime
Release date: addTime
An article will be published after it is published. If it is modified, a modification time will be saved.
Retrieve data on the homepage and sort the data according to the following rules:
1. For articles with Update time, use upTime and only addTime for release time for sorting in order
// The data retrieved in this way is not required. select * from table order by upTime desc, addTime desc
Reply content:
There are two sorting fields,
Update Time: upTime
Release date: addTime
An article will be published after it is published. If it is modified, a modification time will be saved.
Retrieve data on the homepage and sort the data according to the following rules:
1. For articles with Update time, use upTime and only addTime for release time for sorting in order
// The data retrieved in this way is not required. select * from table order by upTime desc, addTime desc
Select * from table order by case when upTime is null then addTime desc else upTime desc end
Maybe you have a problem with your thinking? I think it is dizzy.
At the first release of the articleaddTime
AndupTime
Isn't it? To retrieve data, you only need to useupTime
Sorting is fine, because there is noupTime
NoupTime
In the caseupTime
EqualaddTime
.
UpTime = addTime
If not, add a field for sorting.