Created
February 23, 2019 19:04
-
-
Save kovid-rathee/86dc1a14d402b89a255ddc4a2bc9ce60 to your computer and use it in GitHub Desktop.
Convert Timestamp to ISO-8601 Date format (YYYYMMDD)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drop function if exists transformation_utils.ts_to_isodate (p_timestamp timestamp); | |
create or replace function transformation_utils.ts_to_isodate (p_timestamp timestamp) | |
returns integer AS | |
$body$ | |
declare | |
d integer; | |
begin | |
select to_char(p_timestamp::timestamp, 'YYYYMMDD') into d; | |
return d; | |
end; | |
$body$ | |
language 'plpgsql'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment