How to extract week number in sql

后端 未结 4 1356
难免孤独
难免孤独 2020-11-29 05:40

I have a transdate column of varchar2 type which has the following entrees

01/02/2012
01/03/2012

etc.

I converted it in to date fo

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-29 06:46

    Try to replace 'w' for 'iw'. For example:

    SELECT to_char(to_date(TRANSDATE, 'dd-mm-yyyy'), 'iw') as weeknumber from YOUR_TABLE;
    

提交回复
热议问题