mysql ORDER BY statement
Translation results:
order
UK[ˈɔ:də(r)] US[ˈɔ:rdə(r)]
n. Order; command; sequence; rule, System
vt. Order; order; organize
vi. Place an order
Third person singular: orders Plural: orders Present participle: ordering Past tense: ordered Past participle: ordered
by
英[baɪ] 美[baɪ]
prep.beside...;expression;because;through
adv. pass; used when expressing retention or preservation; short visit
mysql ORDER BY statementsyntax
Function: Used to sort the result set.
Syntax: Order: SELECT * from table name ORDER BY sorted field name Reverse order: SELECT * from table name ORDER BY sorted field name DESC
Description: The ORDER BY statement is used to sort the result set based on the specified column. The ORDER BY statement sorts records in ascending order by default. If you want to sort records in descending order, you can use the DESC keyword.
mysql ORDER BY statementexample
//以字母顺序显示公司名称 SELECT Company, OrderNumber FROM Orders ORDER BY Company; //以字母顺序显示公司名称(Company),并以数字顺序显示顺序号(OrderNumber) SELECT Company, OrderNumber FROM Orders ORDER BY Company, OrderNumber; //以逆字母顺序显示公司名称 SELECT Company, OrderNumber FROM Orders ORDER BY Company DESC;
Popular Recommendations
- Understanding Higher-Order Components and Higher-Order Functions in JavaScript
- Best build order in Age of Mythology: Retold
- Should you choose Order or Faith for New London in Frostpunk 2?
- Samsung opens pre-order for Galaxy Watch FE LTE edition in the US
- Best Satisfactory 1.0 Milestone upgrade order for every tier: All unlocks and costs
- AOOSTAR GEM10 370 pre-order price suggests Strix Point mini PCs won\'t be affordable