SQL

Time Dimension – SQL Query

Posted on:

SELECT— DAY LEVELtime_id AS day_id,INITCAP(TO_CHAR(time_id,’fmMonth DD, YYYY’)) AS day_desc,INITCAP(TO_CHAR(time_id, ‘fmDAY’)) AS day_name,TO_NUMBER(TO_CHAR(time_id – 1, ‘D’)) AS day_of_week,TO_NUMBER(TO_CHAR(time_id, ‘DD’)) AS day_of_month,TO_NUMBER(TO_CHAR(time_id, ‘DDD’)) AS day_of_year,1 AS days_in_day, — MONTH LEVELTO_CHAR(time_id, […]