在 SELECT 语句中使用函数 / 时间函数 |
图: 查询
SELECT customer_num, DAY (call_dtime), DAY (res_dtime) FROM cust_calls;
图: 查询结果
customer_num (expression) (expression) 106 12 12 110 7 7 119 1 2 121 10 10 127 31 116 28 28 116 21 27
图: 查询
SELECT customer_num, DAY (call_dtime), DAY (res_dtime) FROM cust_calls WHERE DAY (call_dtime) < DAY (CURRENT);
图: 查询结果
customer_num (expression) (expression) 106 12 12 110 7 7 119 1 2 121 10 10
图: 查询
SELECT customer_num, call_code, call_descr FROM cust_calls WHERE call_dtime < CURRENT YEAR TO DAY;
图: 查询结果
customer_num 106 call_code D call_descr Order was received, but two of the cans of ANZ tennis balls within the case were empty customer_num 110 call_code L call_descr Order placed one month ago (6/7) not received. ⋮ customer_num 116 call_code I call_descr Second complaint from this customer! Received two cases right-handed outfielder gloves (1 HRO) instead of one case lefties.
SYSDATE 函数与 CURRENT 函数及其类似,但当未指定 DATETIME 限定符时,其返回值的缺省精度是 DATETIME YEAR TO FRACTION(5),而不是 CURRENT 的缺省精度 DATETIME YEAR TO FRACTION(3)。