john8675309 wrote:I am trying to write a query that says show me all records in the last_login field that are older then 30 days. How can I do this in postgresql I know in mysql you can use the currdate function.
I'll assume last_login is a date or timestamp field...
select * from table where last_login < current_date - interval '30 days'
Any database that supports SQL standard dates / timestamps and intervals should be able to run that query.