提交 e166ac36 authored 作者: Thomas Mueller's avatar Thomas Mueller

MySQL compatibility: TIMESTAMPDIFF is now an alias for DATEDIFF.

上级 b29a5be2
......@@ -255,6 +255,7 @@ public class Function extends Expression implements FunctionCall {
addFunctionNotDeterministic("NOW", NOW, VAR_ARGS, Value.TIMESTAMP);
addFunction("DATEADD", DATE_ADD, 3, Value.TIMESTAMP);
addFunction("DATEDIFF", DATE_DIFF, 3, Value.LONG);
addFunction("TIMESTAMPDIFF", DATE_DIFF, 3, Value.LONG);
addFunction("DAYNAME", DAY_NAME, 1, Value.STRING);
addFunction("DAYNAME", DAY_NAME, 1, Value.STRING);
addFunction("DAY", DAY_OF_MONTH, 1, Value.INT);
......
select timestampdiff(month, '2003-02-01','2003-05-01');
> 3;
select timestampdiff(YEAR,'2002-05-01','2001-01-01');
> -1;
select timestampdiff(MINUTE,'2003-02-01','2003-05-01 12:05:55');
> 128885;
select x from (select *, rownum as r from system_range(1, 3)) where r=2;
> 2;
select cast(cast('01020304-0506-0708-090a-0b0c0d0e0f00' as uuid) as binary);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论