简体   繁体   中英

SQL query, date functions

This is my table

表架构

I need to find the "CF" of the people who have Data_Iscrizione<(Current Data-5 years) .

SELECT U.CF
FROM utente AS U
WHERE ???

I've tried to use DATEDIFF , DATE_SUB , CURRENT_DATE and everything I've found on the Internet, but I'm not able to make it work. Any advice?

您将使用date_sub()

where Data_Iscrizione < date_sub(curdate(), interval 5 year)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM