问题
Given 03/09/1982
how can we say it is which week day. In this case it will be Tue
.
Is it possible to get in a single query?
回答1:
SQL> SELECT TO_CHAR(date '1982-03-09', 'DAY') day FROM dual;
DAY
---------
TUESDAY
SQL> SELECT TO_CHAR(date '1982-03-09', 'DY') day FROM dual;
DAY
---
TUE
SQL> SELECT TO_CHAR(date '1982-03-09', 'Dy') day FROM dual;
DAY
---
Tue
(Note that the queries use ANSI date literals, which follow the ISO-8601 date standard and avoid date format ambiguity.)
回答2:
Sorry for a too late answer. but someone might come to this post and see this .
Use
You can use other options in 2nd parameter as it has a lot of variety.
来源:https://stackoverflow.com/questions/8004645/how-to-get-the-week-day-name-from-a-date