当前位置:网站首页>PostgreSQL basic functions
PostgreSQL basic functions
2022-04-23 20:16:00 【Tomorrow's sun】
PostgreSQL function
operation | SQL | Java | JavaScript |
---|---|---|---|
length | length( str ) | str . length() | str . length |
Is it empty | str = '' | str . isEmpty() | str -- if(str) |
Location | position( sub in str ) | str . indexOf( sub ) | str . indexOf( sub ) str . search( regex ) |
matching | str LIKE '%' || sub || '%' str SIMILAR TO pattern str ~ regex |
str . contains( sub ) str . matches( regex ) Pattern.matches( regex, str ) |
str . match( regex ) |
Draw out ( Location ) | substring( str from pos for len ) substr( str, pos, len ) |
str . substring( pos, pos + len ) | str . substring( pos, pos + len ) str . substr( pos, len ) |
Draw out ( about ) | left( str, len ) -- 9.1 right( str, len ) -- 9.1 |
str . substring( 0, len ) str . substring( str.length() - len ) |
str . substring( 0, len ) str . substring( str.length - len ) |
Draw out ( Regular expressions ) | substring( src from regex ) regexp_matches( src, regex ) |
Pattern.compile( regex ).matcher( str ).group( n ) | str . match( regex ) |
Replace ( Location ) | overlay( str placing rep from pos for len ) | StringUtils.overlay( str, rep, start, end ) | N/A |
Replace ( Regular expressions ) | regexp_replace( str, regex, rep, 'g' ) translate( str, from, to ) |
str . replaceAll( regex, rep ) Pattern.compile( regex ).matcher( str ).replaceAll( rep ) |
str . replace( regex, rep ) |
Connect | str1 || str2 concat( str1, str2, ... ) -- 9.1 concat_ws( sep, str1, str2, ... ) -- 9.1 |
str1 + str2 str1 . concat( str2 ) |
Same as left |
combination | array_to_string( array, sep ) string_agg( setof_str, sep ) -- 9.0 |
StringUtils.join( array, sep ) | array . join( sep ) |
Division | string_to_array( str, sep ) regexp_split_to_array( str, regex, 'g' ) regexp_split_to_table( str, regex, 'g' ) |
str . split( regex ) Pattern.compile( regex ).split( str ) |
str . split( regex ) |
trim | trim([leading|trailing|both] trimmed fromstr) ltrim( str, trimmed ) rtrim( str, trimmed ) |
str . trim() | str . replace(/^\s+|\s+$/g, "") |
repeat | repeat( str, n ) | StringUtils.repeat( str, n ) | N/A |
Turn to lowercase | lower( str ) | str . toLowerCase() | Same as left |
Turn it into capital letters | upper( str ) | str . toUpperCase() | Same as left |
reverse | reverse( str ) -- 9.1 | StringUtils.reverse( str ) | N/A |
format | format( format, arg1, ... ) -- 9.1 | String.format( format, arg1, ... ) | N/A |
版权声明
本文为[Tomorrow's sun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210553340031.html
边栏推荐
- 网络通信基础(局域网、广域网、IP地址、端口号、协议、封装、分用)
- Redis installation (centos7 command line installation)
- 2022 - Data Warehouse - [time dimension table] - year, week and holiday
- SIGIR'22 "Microsoft" CTR estimation: using context information to promote feature representation learning
- 如何在BNB鏈上創建BEP-20通證
- Redis distributed lock
- Mysql database - single table query (II)
- Kubernetes introduction to mastery - ktconnect (full name: kubernetes toolkit connect) is a small tool based on kubernetes environment to improve the efficiency of local test joint debugging.
- Kubernetes getting started to proficient - install openelb on kubernetes
- Confusion about thread blocking after calling the read () method of wrapper flow
猜你喜欢
How to protect ECs from hacker attacks?
An error is reported when sqoop imports data from Mysql to HDFS: sqlexception in nextkeyvalue
Notes of Tang Shu's grammar class in postgraduate entrance examination English
LeetCode动态规划训练营(1~5天)
SIGIR'22「微软」CTR估计:利用上下文信息促进特征表征学习
PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
WordPress plug-in: WP CHINA Yes solution to slow domestic access to the official website
基于pytorch搭建GoogleNet神经网络用于花类识别
【目标跟踪】基于帧差法结合卡尔曼滤波实现行人姿态识别附matlab代码
Comment créer un pass BEP - 20 sur la chaîne BNB
随机推荐
2022 - Data Warehouse - [time dimension table] - year, week and holiday
Mysql database - single table query (III)
Fundamentals of programming language (2)
Markdown < a > tag new page open link
[target tracking] pedestrian attitude recognition based on frame difference method combined with Kalman filter, with matlab code
nc基础用法4
Compact CUDA tutorial - CUDA driver API
[problem solving] 'ASCII' codec can't encode characters in position XX XX: ordinal not in range (128)
論文寫作 19: 會議論文與期刊論文的區別
使用 WPAD/PAC 和 JScript在win11中进行远程代码执行3
An error is reported in the initialization metadata of the dolphin scheduler -- it turns out that there is a special symbol in the password. "$“
[talkative cloud native] load balancing - the passenger flow of small restaurants has increased
Livego + ffmpeg + RTMP + flvjs to realize live video
Remote code execution in Win 11 using wpad / PAC and JScript 3
Alicloud: could not connect to SMTP host: SMTP 163.com, port: 25
PHP reference manual string (7.2000 words)
The textarea cursor cannot be controlled by the keyboard due to antd dropdown + modal + textarea
SRS 的部署
selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT
PCA based geometric feature calculation of PCL point cloud processing (52)