范圍比較
字符串被轉為double
SELECT i FROM t WHERE i <= all {'11','12'};
i
=============
1
2
3
4
字符串轉為日期或時間
SELECT s FROM t2;
s
======================
'01/01/2000'
'01/01/1999'
'01/01/1998'
SELECT s FROM t2 WHERE s <= ALL {date'02/02/1998',date'01/01/2000'};
s
======================
'01/01/1998'
報錯了
如果日期是間操作是-操作. 返回的是毫秒
SELECT date'2002-01-01' - datetime'2001-02-02 12:00:00 am';
date '2002-01-01'- datetime '2001-02-02 12:00:00 am'
=====================================================
28771200000
DATE: 返回天
TIME, TIMESTAMP:返回 秒
DATETIME:返回 毫秒
SELECT date'2002-01-01' + '10';
date '2002-01-01'+'10'
======================
01/11/2002
SELECT date'2002-01-01'-'2001-01-01';
date '2002-01-01'-'2001-01-01'
================================
31536000000
-- 下面的操作是不可以的
SELECT date'2002-01-01'-'10';
In line 1, column 13,
ERROR: 10不是日期類型.
SELECT 4 + '5.2';
4+'5.2'
==========================
9.199999999999999e+00
SELECT '2002-01-01'+1;
ERROR: 不能把'2002-01-01'轉為double類型
SELECT DATE'2002-01-01'+1;
date '2002-01-01'+1
=====================
01/02/2002
字符串的乘除操作返回double類型
SELECT '3'*'2';
'3'*'2'
============================
6.000000000000000e+00
字符串的加操作為連接操作. ( 具體跟對加號的意義的配置有關 plus_as_concat 在 cubrid.conf中 )
An error will be returned if it cannot be converted to the corresponding type.