我正在尝试学习 sql,但我有一个问题。如何按天的逻辑顺序对输出进行排序?例如,我希望从 'Monday' 到 'Sunday' 订购 HIREDAY 的人。
select first_name,
TO_CHAR(hire_date,'Day') as "HIREDAY"
from employees
order by HIREDAY;
输出:
Daniel Friday
Ismael Friday
Gerald Monday
Renske Monday
Jason Monday
Vance Saturday
Jenni Saturday
Michael Saturday
John Sunday
James Sunday
Matthew Sunday
Payam Thursday
Irene Thursday
Michael Tuesday
Kevin Tuesday
Anthony Wednesday
Karen Wednesday