SQL排序 desc和ASC有什么辨别

SQL排序 desc和ASC有什么辨别

SQL 语句中

asc是指定列按叶序陈设(即:自小到大排序) —降序陈设

desc则是指定列按降序陈设(即:从大到小排序) —叶序陈设

排序子句语法:order by 列名 asc/desc

<!--订单列表,降序须要排序一下-->

<select id="listOrderByUserId" resultType="VideoOrder">

select * from video_order where user_id = #{user_id} order by create_time desc

</select>

分享到 :

Leave a Reply

Your email address will not be published. Required fields are marked *