Mysql SQL错误[102][42000]:靠近';的语法不正确';
我认为您需要Mysql SQL错误[102][42000]:靠近';的语法不正确';,mysql,Mysql,我认为您需要DATEDIFF函数和now(),因为getdate()是sql server函数 select customerno,(GETDATE() - date_connected) as days_connected from ( select customerno, min(ch.connectiondatetime) as date_connected from ConnectionHistory ch GROUP by customerno ha
DATEDIFF
函数和now()
,因为getdate()是sql server函数
select customerno,(GETDATE() - date_connected) as days_connected from (
select customerno, min(ch.connectiondatetime) as date_connected
from ConnectionHistory ch
GROUP by customerno
having (GETDATE() - date_connected > 90)
)
示例数据和预期输出有助于正确解决问题我想要连接超过90天的客户的数据给我一个错误“DATE”不是一个可识别的内置函数名。@shonny现在检查是否仍然会出现相同的错误。我使用的是dbeaver-mysql服务器
select customerno,DATEDIFF( date(now()), date(date_connected)) as days_connected from
(
select ch.customerno, min(ch.connectiondatetime) as date_connected
from ConnectionHistory ch
GROUP by customerno
having DATEDIFF(date(now()),date(date_connected))>90
) as T