当前位置:网站首页>数据库 逻辑处理功能
数据库 逻辑处理功能
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;

边栏推荐
- Use of websocket tool
- Icml2022 | partial and asymmetric comparative learning of out of distribution detection in long tail recognition
- 视频自监督学习综述
- 7-1 linked list is also simple fina
- 在线协作产品哪家强?微软 Loop 、Notion、FlowUs
- Word查找红色文字 Word查找颜色字体 Word查找突出格式文本
- Taishan Office Technology Lecture: from the layout height of the line, talk about the height overflow and height shrinkage of the drawing height (launched in the whole network)
- 2022 latest Android interview written examination, an Android programmer's interview experience
- Optimization of middle alignment of loading style of device player in easycvr electronic map
- Go deep into the underlying C source code and explain the core design principles of redis
猜你喜欢

Tianyi cloud understands enterprise level data security in this way

彻底理解为什么网络 I/O 会被阻塞?

中文版Postman?功能真心强大!

C# 语言的基本语法结构

基于FPGA的超声波测距

Oracle 中文排序 Oracle 中文字段排序

Ant group open source trusted privacy computing framework "argot": open and universal

块编辑器如何选择?印象笔记 Verse、Notion、FlowUs

Mysql database indexing tutorial (super detailed)
![[today in history] July 5: the mother of Google was born; Two Turing Award pioneers born on the same day](/img/7d/7a01c8c6923077d6c201bf1ae02c8c.png)
[today in history] July 5: the mother of Google was born; Two Turing Award pioneers born on the same day
随机推荐
Reading notes of Clickhouse principle analysis and Application Practice (5)
UDF implementation of Dameng database
2022最新大厂Android面试真题解析,Android开发必会技术
Technology sharing | interface testing value and system
Why can't Bi software do correlation analysis? Take you to analyze
Rse2020/ cloud detection: accurate cloud detection of high-resolution remote sensing images based on weak supervision and deep learning
7-2 keep the linked list in order
公司破产后,黑石们来了
[today in history] July 5: the mother of Google was born; Two Turing Award pioneers born on the same day
彻底理解为什么网络 I/O 会被阻塞?
自动化测试的好处
Advanced application of C # language
Icml2022 | partial and asymmetric comparative learning of out of distribution detection in long tail recognition
Case sharing | integrated construction of data operation and maintenance in the financial industry
Golang through pointer for Range implements the change of the value of the element in the slice
Cf:b. almost Terry matrix [symmetry + finding rules + structure + I am structural garbage]
The basic grammatical structure of C language
【历史上的今天】7 月 5 日:Google 之母出生;同一天诞生的两位图灵奖先驱
The era of Web3.0 is coming. See how Tianyi cloud storage resources revitalize the system to enable new infrastructure (Part 2)
Word查找红色文字 Word查找颜色字体 Word查找突出格式文本