0

我要使用的表是

create type Rehearsal_ty as object
(RehID char(4),
RLocation add_ty,
Attendance varchar2 (100),
RDate date)

create table Rehearsal_tbl of Rehearsal_ty

我尝试使用的 select 语句无法正常工作

SELECT rehid, DATEPART(wk,rdate)
from Rehearsal_tbl

SELECT DATEPART (ww,rdate())
FROM Rehearsal_tbl;

请帮助真的卡住了

4

1 回答 1

0

(更新) 看起来 Oracle 文档不正确 - 这是一个有效的版本。你可以在这里测试它:http ://sqlfiddle.com/#!4/77080/7

select RehID, to_char(rdate, 'IW') as IsoWeekChar
from Rehearsal_tbl;

.

select RehID, to_char(rdate, 'WW') as IsoWeekChar
from Rehearsal_tbl;

.

select RehID, to_number(to_char(rdate, 'IW')) as IsoWeekNumeric
from Rehearsal_tbl;

.

select RehID, to_number(to_char(rdate, 'WW')) as OraWeekNumeric
from Rehearsal_tbl;
于 2012-12-08T01:10:04.133 回答