当前位置:网站首页>Database logic processing function
Database logic processing function
2022-07-05 19:51:00 【My talented girlfriend】
function
Numerical function
- abs(x) The absolute value
- ceil(x) Greater than or equal to x Minimum integer of
- floor(x) Less than or equal to x Maximum integer for
- mod(x,y) x Divide y The remainder of
- round(x,n) take x Round to n Decimal place
- rand() Returns a random number
Character functions
- char_length(s) Character length
- concat(a,b) Character connection
- instr(s,s1) Returns the first occurrence of a character , Case insensitive
- lower(a) / upper(b) Case conversion
- octet_length(s) The length of the returned character bytes ,utf-8 Character occupation 3 Characters
- substring(s,n,m) Intercept characters from n At the beginning m Letters , The position is calculated from 1 Start
- trim(s1 from s) Delete the beginning and end characters , Default is space
Date function
- current_date The current date
- current_time current time
- current_timestamp Current time and date
- extract(p from date) Extract information from dates
- datediff(d1, d2) Calculate the number of days between dates
- d1 + interval Date plus time interval
select date ‘2011-11-12’ + interval ‘-1’ month t_goodss
Conversion function
- cast
Alias
Both column names and table names use keywords AS
Conditional expression
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 and java The trinocular expression in is similar
select if(1<2, '1<2','1>=2') as result;
边栏推荐
- C - sequential structure
- 通配符选择器
- Build your own website (16)
- 面试官:Redis中集合数据类型的内部实现方式是什么?
- 深度學習 卷積神經網絡(CNN)基礎
- acm入门day1
- 打新债在哪里操作开户是更安全可靠的呢
- Redis cluster simulated message queue
- Win10 x64环境下基于VS2017和cmake-gui配置使用zxing以及opencv,并实现data metrix码的简单检测
- After 95, Alibaba P7 published the payroll: it's really fragrant to make up this
猜你喜欢
JMeter 常用的几种断言方法,你会了吗?
城链科技数字化创新战略峰会圆满召开
MMO項目學習一:預熱
Inventory of the most complete low code / no code platforms in the whole network: Jiandao cloud, partner cloud, Mingdao cloud, Qingliu, xurong cloud, Jijian cloud, treelab, nailing · Yida, Tencent clo
The city chain technology Digital Innovation Strategy Summit was successfully held
测试的核心价值到底是什么?
ACM getting started Day1
Debezium series: record the messages parsed by debezium and the solutions after the MariaDB database deletes multiple temporary tables
图嵌入Graph embedding学习笔记
【无标题】
随机推荐
gst-launch的-v参数
MMO project learning 1: preheating
MMO項目學習一:預熱
面试官:Redis中集合数据类型的内部实现方式是什么?
不愧是大佬,字节大牛耗时八个月又一力作
Bitcoinwin (BCW) was invited to attend Hanoi traders fair 2022
完爆面试官,一线互联网企业高级Android工程师面试题大全
Reptile exercises (II)
Thread pool parameters and reasonable settings
Postman core function analysis - parameterization and test report
C#应用程序界面开发基础——窗体控制(6)——菜单栏、工具栏和状态栏控件
Redis cluster simulated message queue
The problem of returning the longtext field in MySQL and its solution
C application interface development foundation - form control (5) - grouping control
Gstreamer中的task
After 95, Alibaba P7 published the payroll: it's really fragrant to make up this
95后阿里P7晒出工资单:狠补了这个,真香...
Fundamentals of deep learning convolutional neural network (CNN)
[Collection - industry solutions] how to build a high-performance data acceleration and data editing platform
Common - Hero Minesweeper