Here is my little trouble. I want to extract some parts of a datetime
field in a postgresql database.
I played around with the func.year(), func.month() but it sounds like
postgresql doesn't understand the resulting query. For example, a
func.year() call is converted into :
select year(myDateTime) from mytable;
This works with MySQL but not with Postgresql. The error is "function
year(timestamp without time zone) doesn't exist"
I guess the resulting Postgresql query should be :
select EXTRACT (year FROM myDateTime) from mytable;
Any clue ???
Regards,
Laurent
so you could write func.date_part('year', mydatetime)
Regards,
Laurent
Jonathan Ellis a écrit :