Determine if Oracle date is on a weekend?
问题 Is this the best way to determine if an Oracle date is on a weekend? select * from mytable where TO_CHAR (my_date, 'DY', 'NLS_DATE_LANGUAGE=ENGLISH') IN ('SAT', 'SUN'); 回答1: As of Oracle 11g, yes. The only viable region agnostic alternative that I've seen is as follows: SELECT * FROM mytable WHERE MOD(TO_CHAR(my_date, 'J'), 7) + 1 IN (6, 7); 回答2: Not an answer to the question . But some more information. There are many more SQL tricks with date. to_char(sysdate, 'd') --- day of a week, 1,2,3