3 回答

TA贡献1804条经验 获得超8个赞
ORDER BY article_rating, article_time DESC
仅当有两篇具有相同评级的文章时才会按article_time排序。从我在你的例子中可以看到的一切,这正是发生的事情。
↓ primary sort secondary sort ↓
1. 50 | This article rocks | Feb 4, 2009 3.
2. 35 | This article is pretty good | Feb 1, 2009 2.
3. 5 | This Article isn't so hot | Jan 25, 2009 1.
但考虑一下:
↓ primary sort secondary sort ↓
1. 50 | This article rocks | Feb 2, 2009 3.
1. 50 | This article rocks, too | Feb 4, 2009 4.
2. 35 | This article is pretty good | Feb 1, 2009 2.
3. 5 | This Article isn't so hot | Jan 25, 2009 1.
添加回答
举报