>데이터 베이스 >MySQL 튜토리얼 >mysql的默许排序规则探讨

mysql的默许排序规则探讨

WBOY
WBOY원래의
2016-06-07 16:27:05929검색

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) ? 排序规则:

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

?

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.