Someone could tell me if there is an error in the query below:
select name, cast(Extract(day from payday) as int) as 'day' from loan;
I can not find the reason for having a compile error in the URI.
Someone could tell me if there is an error in the query below:
select name, cast(Extract(day from payday) as int) as 'day' from loan;
I can not find the reason for having a compile error in the URI.
I thought the problem would be in cast ; I was creating this fiddle and realized that the error message ( 42601: syntax error at or near "'day'" ) is related to the alias , not the extract
.
Removing quotation marks, the problem is solved:
select name, cast(Extract(day from payday) as int) as day from loan;