首頁 >資料庫 >mysql教程 >mysql的默许排序规则探讨

mysql的默许排序规则探讨

WBOY
WBOY原創
2016-06-07 16:27:05930瀏覽

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