0
如果時間差結果是否定的我如何將其設置爲零如何負時差值設置爲零
select TIMEDIFF('2016-01-29 12:28:18','2016-01-29 19:27:51') as diff;
| -06:59:33 |
如果時間差結果是否定的我如何將其設置爲零如何負時差值設置爲零
select TIMEDIFF('2016-01-29 12:28:18','2016-01-29 19:27:51') as diff;
| -06:59:33 |
嘗試這種情況:
select if((time_to_sec(TIMEDIFF('2016-01-29 12:28:18','2016-01-29 19:27:51'))/3600) < 0,0,TIMEDIFF('2016-01-29 12:28:18','2016-01-29 19:27:51')) as diff;
例如最大(X,0) – Strawberry