问题
I am putting together a membership database for a nonprofit charity in LibreOffice, but have no experience in mysql queries so I would appreciate the help.
I am trying to create a query that displays all records where the membership signup date field (PaymentDate) is older than 1 year of the current date AND a boolean value of another field (AwaitingRenewal) is NO. The date is in 05/03/85 format. Thanks for any help you can give me!
回答1:
You can do something like:
select * from `members`
where `paymentDate` < DATE_SUB(CURDATE(), INTERVAL 1 YEAR)
and `AwaitingRenewal` = 'NO'
回答2:
* from dt_tb where `dt` >= DATE_SUB(CURDATE(), INTERVAL 1 YEAR)
回答3:
Solved: Older mysql syntax required.
来源:https://stackoverflow.com/questions/12736092/mysql-query-query-all-entries-older-than-1-year