首页 >数据库 >mysql教程 >mysql的默许排序规则探讨

mysql的默许排序规则探讨

WBOY
WBOY原创
2016-06-07 16:27:05934浏览

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