I have table in which mydate is stored in a character varying column in the following format YYYY-MM-DD. Some rows in this table are empty for this column. I want to format the date as follows:
SELECT to_char(date mydate, 'FMDay FMDD FMMonth FMYYYY')
FROM my_table where mydate is not null limit 10;
But I get the following error: ERROR: syntax error at or near "mydate"
LINE 1: select to_char(date mydate, 'FMDay FMDD FMMonth FMYYY...
Why is this happening.
varchar? Don't do that.