@author: Tobin
@date: 2019/10/28 22:14:16
支持的函数,方便处理数据。
# Upper() 大写
SELECT vend_name, Upper(vend_name) AS vend_name_upcase
FROM vendors
ORDER BY vend_name;
# Left() 返回串左边的字符
# Length() 返回串的长度
# Locate() 找出串的第一个子串
# Lower() 将串转换为小写
# LTrim() 去掉串左边的空格
# Right() 返回串右边的字符
# RTrim() 去掉串右边的空格
# Soundex() 返回串的SOUNDEX值,Soundex()可以找到发音相似的人名
# SubString() 返回子串的字符
# Upper() 将串转为大写
日期和时间处理函数
# 具体某天的订单
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
数值处理函数
原文地址:https://www.cnblogs.com/zuotongbin/p/11814152.html
时间: 2024-11-13 10:02:00