#文本处理函数 SELECT vend_name, Upper(vend_name) AS vend_name_upcase FROM vendors ORDER BY vend_name; SELECT cust_name, cust_contact FROM customers WHERE Soundex(cust_contact) = Soundex('Y Lie'); #Soundex()匹配所有发音类似于Y.Lie的联系名 #日期和时间处理函数 SELECT cust_id, order_num FROM orders WHERE order_date = '2005-09-01'; #这种全行匹配不可靠,下面的用一些日期函数处理更准确。比如不能匹配带有时分秒的列 SELECT cust_id, order_num FROM orders WHERE Date(order_date) = '2005-09-01'; SELECT cust_id, order_num FROM orders WHERE Date(order_date) BETWEEN '2005-09-01' AND '2005-09-30'; SELECT cust_id, order_num FROM orders WHERE Year(order_date) = 2005 AND Month(order_date) = 9;
常用的文本处理函数:
常用的日期和时间处理函数:
常用的数值处理函数: