SELECT table.field FROM table WHERE table.month = 'october' AND DATEDIFF(day,table.start_date,table.end_date) < 30
我列中的日期格式为m-d-yy
我需要将其转换为其他格式吗?如果是这样的话?
使用MariaDB
DATEDIFF
Syntax DATEDIFF(expr1,expr2) Description DATEDIFF() returns (expr1 – expr2) expressed as a value in days from one date to the other. expr1 and expr2 are date or date-and-time expressions. Only the date parts of the values are used in the calculation.
Syntax
DATEDIFF(expr1,expr2)
Description
DATEDIFF() returns (expr1 – expr2) expressed as a value in days from one date to the other. expr1 and expr2 are date or date-and-time expressions. Only the date parts of the values are used in the calculation.
DATEDIFF()
(expr1 – expr2)
expr1
expr2