Home > Database > Mysql Tutorial > mysql的默许排序规则探讨

mysql的默许排序规则探讨

WBOY
Release: 2016-06-07 16:27:05
Original
927 people have browsed it

mysql的默认排序规则探讨 3个SQL语句的不同结果(注意sid的值): ? mysql? select ? sid,order_no,order_status? from ? oms_order???limit?10; + -----+----------------+--------------+ |?sid?|?order_no???????|?order_status?| + -----+---------------

mysql的默认排序规则探讨


3个SQL语句的不同结果(注意sid的值):

?

mysql>?select?sid,order_no,order_status?from?oms_order???limit?10; +-----+----------------+--------------+ |?sid?|?order_no???????|?order_status?| +-----+----------------+--------------+ |??20?|?20100319000003?|????????????0?| |??21?|?20100319000004?|????????????0?| |??63?|?20100319000046?|???????????-1?| |??69?|?20100320000006?|????????????0?| |??76?|?20100323000001?|????????????0?| |??77?|?20100323000002?|????????????0?| |??78?|?20100323000003?|????????????0?| |??79?|?20100323000004?|????????????8?| |??86?|?20100324000007?|???????????-1?| |??93?|?20100324000014?|???????????-1?| +-----+----------------+--------------+ 10?rows?in?set?(0.00?sec) ? mysql><span>?</span>select?sid,order_status?from?oms_order???limit?10; +-----+--------------+ |?sid?|?order_status?| +-----+--------------+ |?240?|???????????-1?| |?261?|???????????-1?| |?263?|???????????-1?| |?285?|???????????-1?| |?286?|???????????-1?| |?288?|???????????-1?| |?339?|???????????-1?| |?383?|???????????-1?| |?387?|???????????-1?| |?452?|???????????-1?| +-----+--------------+ 10?rows?in?set?(0.00?sec) ? mysql>?select?sid?from?oms_order???limit?10; +---------+ |?sid?????| +---------+ |?1171641?| |?1171651?| |?1171661?| |?1171671?| |?1171681?| |?1171691?| |?1171701?| |??????20?| |??????21?| |??????63?| +---------+ 10?rows?in?set?(0.00?sec) ? 排序规则:

? ? 以上信息整理与互联网,笔者本人还没完全搞懂,大家可以探讨!

?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template