Mysql数据库查出的数据默认排序方式

Mysql数据库查出的数据默认排序方式,第1张

你的表示myisam时:

SELECT * FROM tbl -- this will do a "table scan". If the table has never had any DELETEs/REPLACEs/UPDATEs, the records will happen to be in the insertion order, hence what you observed.

mySQL里desc和asc的意思

desc是descend 降序意思

asc 是ascend 升序意思

sql = "select 表内容名from 数据库表名 Putout=true order by 读取的排序表名 asc"

例如

sql = "select * from user where Putout=true order by timedesc"//按最新时间来排序

sql = "select * from user where Putout=true order by timeasc" //按早时间来排序


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/7183363.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-02
下一篇2023-04-02

发表评论

登录后才能评论

评论列表(0条)

    保存