SELECT select_list
FROM table_source
[ WHERE search_condition ]
[ GROUP BY group_by_expression ]
[ HAVING search_condition ]
[ ORDER BY order_expression [ ASC | DESC ] ]

使用GROUP BY搭配aggregate function

select number,max(name)
from student
group by number
order by number

使用[GROUP BY]後,再用[ORDER BY],能拿你select_list的欄位來排序,
如要使用
aggregate function,則須設定別名

select number,max(name) as X1
from student
group by number
order by X1