Hi,
I want to select day, month and year out of a date field in PostgreSQL.
The field is datecalc.
I moved this query from MS SQL Server to Postgres so I could access the right table.
Here is the query? does anyone know how I can change this to work?
select l.id, l.primaryname, DAY(lp.calcdate) as day, lp.popularity, lp.categorypopularity
from t_location l left join
t_location_popularity_history lp on l.id=lp.locationid
where YEAR(lp.calcdate)=2011 and l.id in (1818266,
224770)
group by l.id, l.primaryname, DAY(lp.calcdate), lp.popularity, lp.categorypopularity