当前位置:网站首页>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;
边栏推荐
- What is the function of okcc call center
- 随机数生成的四种方法|Random|Math|ThreadLocalRandom|SecurityRandom
- Do you know several assertion methods commonly used by JMeter?
- 国信证券在网上开户安全吗?
- [C language] string function and Simulation Implementation strlen & strcpy & strcat & StrCmp
- 爬虫练习题(二)
- What does software testing do? What are the requirements for learning?
- Is the education of caiqiantang reliable and safe?
- Webuploader file upload drag upload progress monitoring type control upload result monitoring control
- Android interview, Android audio and video development
猜你喜欢
The city chain technology Digital Innovation Strategy Summit was successfully held
How MySQL queries and modifies JSON data
Jvmrandom cannot set seeds | problem tracing | source code tracing
不愧是大佬,字节大牛耗时八个月又一力作
How to safely and quickly migrate from CentOS to openeuler
[untitled]
C#应用程序界面开发基础——窗体控制(5)——分组类控件
[AI framework basic technology] automatic derivation mechanism (autograd)
PHP uses ueditor to upload pictures and add watermarks
MMO项目学习一:预热
随机推荐
Fundamentals of deep learning convolutional neural network (CNN)
Force buckle 1200 Minimum absolute difference
【obs】QString的UTF-8中文转换到blog打印 UTF-8 char*
How MySQL queries and modifies JSON data
安卓面试宝典,2022Android面试笔试总结
Summer Challenge database Xueba notes, quick review of exams / interviews~
-v parameter of GST launch
Win10 x64环境下基于VS2017和cmake-gui配置使用zxing以及opencv,并实现data metrix码的简单检测
Webuploader file upload drag upload progress monitoring type control upload result monitoring control
建议收藏,我的腾讯Android面试经历分享
Debezium series: PostgreSQL loads the correct last submission LSN from the offset
Debezium series: modify the source code to support drop foreign key if exists FK
Debezium series: parsing the default value character set
Reinforcement learning - learning notes 4 | actor critical
Realizing deep learning framework from zero -- LSTM from theory to practice [practice]
Relationship between floating elements and parent and brother boxes
深度學習 卷積神經網絡(CNN)基礎
S7-200SMART利用V90 MODBUS通信控制库控制V90伺服的具体方法和步骤
What are general items
使用easyexcel模板导出的两个坑(Map空数据列错乱和不支持嵌套对象)