当前位置:网站首页>数据库 逻辑处理功能
数据库 逻辑处理功能
2022-07-05 18:44:00 【我的天才女友】
函数
数值函数
- abs(x) 绝对值
- ceil(x) 大于等于x的最小整数
- floor(x) 小于等于x的最大整数
- mod(x,y) x除以y的余数
- round(x,n) 将x四舍五入到n位小数
- rand() 返回一个随机数

字符函数
- char_length(s) 字符长度
- concat(a,b) 字符连接
- instr(s,s1) 返回字符第一次出现的位置,不区分大小写
- lower(a) / upper(b) 大小写转化
- octet_length(s) 返回字符字节长,utf-8字符占据3个字符
- substring(s,n,m) 截取字符从n开始的m个字母,位置计算从1开始
- trim(s1 from s) 删除开头和结尾的字符,默认是空格

日期函数
- current_date 当前日期
- current_time 当前时间
- current_timestamp 当前时间和日期
- extract(p from date) 从日期中提取信息
- datediff(d1, d2) 计算日期之间的天数
- d1 + interval 日期加上时间间隔
select date ‘2011-11-12’ + interval ‘-1’ month t_goodss

转换函数
- cast
别名
列别名和表别名都使用关键字AS
条件表达式
case
case expression
when value1 then result1
when value2 then result2
else --
end
case
when conditon1 then result1
when conditon2 then result2
else --
end
if
if和java中的三目表达式差不多
select if(1<2, '1<2','1>=2') as result;

边栏推荐
- max31865模块RTD测温注意事项
- cf:B. Almost Ternary Matrix【對稱 + 找規律 + 構造 + 我是構造垃圾】
- 5年经验Android程序员面试27天,2022程序员进阶宝典
- 块编辑器如何选择?印象笔记 Verse、Notion、FlowUs
- Icml2022 | partial and asymmetric comparative learning of out of distribution detection in long tail recognition
- Redhat7.4 configure Yum software warehouse (rhel7.4)
- A cloud opens a new future of smart transportation
- 2022 latest Android interview written examination, an Android programmer's interview experience
- 7-2 keep the linked list in order
- Word finds red text word finds color font word finds highlighted formatted text
猜你喜欢

You can have both fish and bear's paw! Sky wing cloud elastic bare metal is attractive!

5. Data access - entityframework integration

Interprocess communication (IPC): shared memory

小程序 修改样式 ( placeholder、checkbox的样式)

1亿单身男女撑起一个IPO,估值130亿

C# 语言的高级应用

Find in MySQL_ in_ Detailed explanation of set() function usage

【Autosar 十四 启动流程详解】

企业级数据安全,天翼云是这样理解的

Icml2022 | partial and asymmetric comparative learning of out of distribution detection in long tail recognition
随机推荐
尚硅谷尚优选项目教程发布
The era of Web3.0 is coming. See how Tianyi cloud storage resources revitalize the system to enable new infrastructure (Part 2)
2022最新中高级Android面试题目,【原理+实战+视频+源码】
Use file and directory properties and properties
中文版Postman?功能真心强大!
2022 latest intermediate and advanced Android interview questions, [principle + practice + Video + source code]
Powerful tool for collection processing
从外卖点单浅谈伪需求
Use of websocket tool
视频自监督学习综述
技术分享 | 接口测试价值与体系
cf:B. Almost Ternary Matrix【對稱 + 找規律 + 構造 + 我是構造垃圾】
Talking about fake demand from takeout order
Advanced application of C # language
[detailed explanation of AUTOSAR 14 startup process]
1亿单身男女撑起一个IPO,估值130亿
跨境支付平台 XTransfer 的低代码实践:如何与其他中台融合是核心
Web3.0时代来了,看天翼云存储资源盘活系统如何赋能新基建(下)
Postman核心功能解析 —— 参数化和测试报告
max31865模块RTD测温注意事项