为此,请使用timestampdiff函数
CASE:
select case when TIMESTAMPDIFF(SECOND, `date`,current_timestamp) <= 60 then concat(TIMESTAMPDIFF(SECOND, `date`,current_timestamp), ' seconds') when TIMESTAMPDIFF(DAY, `date`,current_timestamp) <= 3 and TIMESTAMPDIFF(DAY, `date`,current_timestamp) >= 1 ... end as time_diff from Table_hellowhere TIMESTAMPDIFF(DAY, `time`,current_timestamp) >= 3



