常用工具: 简繁转换 HTML/JS互转 Url编码Escape解析 Unicode编码转换 设为首页 加入收藏夹
更多内容
" id="arctext" class="center" " class="arcinfo center" " id="slistl" class="left" " id="mid_slistl_sch" class="left" " id="mid_slistl_adv" class="left" " id="mid_slistl_adv2" " src="http://www.fzs8.net/d/js/acmsd/middle2.js"
文章正文

ASP Hex 函数

来源:  网络收集  字体:[ ]
站内搜索系统
文章正文

SQL Order By

来源:  网络收集  2007-05-23 05:53:08 字体:[ ]

The ORDER BY keyword is used to sort the result.
关键字ORDER BY可用来整理结果


Sort the Rows
将几条记录做整理

The ORDER BY clause is used to sort the rows.
ORDER BY 子句用来整理记录行

Orders:
定单数据库表:

CompanyOrderNumber
Sega3412
ABC Shop5678
W3pop2312
W3pop6798

举例

To display the companies in alphabetical order:
显示为按字母顺序排列:

SELECT Company, OrderNumber FROM Orders
ORDER BY Company

结果:

CompanyOrderNumber
ABC Shop 5678
Sega3412
W3pop6798
W3pop2312

举例

To display the companies in alphabetical order AND the ordernumbers in numerical order:
显示的结果按字母排序以及数字大小来排列:

SELECT Company, OrderNumber FROM Orders
ORDER BY Company, OrderNumber

结果:

CompanyOrderNumber
ABC Shop5678
Sega3412
W3pop2312
W3pop6798

举例

To display the companies in reverse alphabetical order:
显示出来的公司名称按字母反向排列:

SELECT Company, OrderNumber FROM Orders
ORDER BY Company DESC

结果:

CompanyOrderNumber
W3pop6798
W3pop2312
Sega3412
ABC Shop5678

举例

To display the companies in reverse alphabetical order AND the ordernumbers in numerical order:
显示的公司名称以及定单数都以反序排列

SELECT Company, OrderNumber FROM Orders
ORDER BY Company DESC, OrderNumber ASC

结果:

CompanyOrderNumber
W3pop2312
W3pop6798
Sega3412
ABC Shop5678

  
上一篇:SQL命令 Delete删除记录
下一篇:SQL 与 & OR
最新文章
推荐文章
热门文章
版权所有:IT加油站   COPYRIGHT © 2007 WWW.FZS8.NET ALL RIGHTS RESERVED.
闽ICP备08008535号