How i will get DATENAME in vertica?
In sql i will get DateName from the following query
SELECT DATENAME(dw,'10/24/2013') as theDayName to return 'Thursday'have any equivalent function in Vertica?
0
Comments
SELECT case EXTRACT(DOW FROM TIMESTAMP '10/24/2013')
when 0 then 'Sunday'
when 1 then 'Monday'
when 2 then 'Tuesday'
when 3 then 'Wednesday'
when 4 then 'Thursday'
when 5 then 'Friday'
when 6 then 'Saturday'
end
You can find some useful functions here: https://github.com/sKwa/vertica/blob/master/UDFSQL/sql_funcs.sql
- is_int
- month_name
- weekday_name
- random_ts [between ts1 and ts2]
- midpoint_timestamp
- season
- is_leap_year
- current_quarter_last_day
Best (aka sKwa)You can also check out this link:
https://community.vertica.com/vertica/topics/is_there_a_function_in_vertica_is_equivalent_to_datenam...
Regards
Bhawana
TO_CHAR
formatting: This returns the full uppercase day name.Day
gives the mixed-case day name, andday
gives the lowercase day name.