当前位置:网站首页>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
边栏推荐
- 使用 WPAD/PAC 和 JScript在win11中进行远程代码执行3
- LeetCode动态规划训练营(1~5天)
- Servlet learning notes
- CVPR 2022 | QueryDet:使用级联稀疏query加速高分辨率下的小目标检测
- Redis installation (centos7 command line installation)
- Comment créer un pass BEP - 20 sur la chaîne BNB
- MySQL advanced lock - overview of MySQL locks and classification of MySQL locks: global lock (data backup), table level lock (table shared read lock, table exclusive write lock, metadata lock and inte
- Introduction to electron tutorial 3 - process communication
- antd dropdown + modal + textarea导致的textarea光标不可被键盘控制问题
- 还在用 ListView?使用 AnimatedList 让列表元素动起来
猜你喜欢

PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)

【数值预测案例】(3) LSTM 时间序列电量预测,附Tensorflow完整代码

Zdns was invited to attend the annual conference of Tencent cloud basic resources and share the 2020 domain name industry development report

Unity general steps for creating a hyper realistic 3D scene

基于pytorch搭建GoogleNet神经网络用于花类识别

波场DAO新物种下场,USDD如何破局稳定币市场?

Grafana shares links with variable parameters

Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference

LeetCode动态规划训练营(1~5天)

考研英语唐叔的语法课笔记
随机推荐
Error reported by Azkaban: Azkaban jobExecutor. utils. process. ProcessFailureException: Process exited with code 127
R language uses the preprocess function of caret package for data preprocessing: BoxCox transform all data columns (convert non normal distribution data columns to normal distribution data and can not
网络通信基础(局域网、广域网、IP地址、端口号、协议、封装、分用)
Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference
如何在BNB鏈上創建BEP-20通證
使用 WPAD/PAC 和 JScript在win11中进行远程代码执行1
How about Bohai futures. Is it safe to open futures accounts?
How does onlyoffice solve no route to host
【问题解决】‘ascii‘ codec can‘t encode characters in position xx-xx: ordinal not in range(128)
Is the wechat CICC wealth high-end zone safe? How to open an account for securities
DTMF双音多频信号仿真演示系统
Redis cache penetration, cache breakdown, cache avalanche
aqs的学习
腾讯邱东洋:深度模型推理加速的术与道
. Ren -- the intimate artifact in the field of vertical Recruitment!
SRS deployment
JDBC tool class jdbcfiledateutil uploads files and date format conversion, including the latest, simplest and easiest way to upload single files and multiple files
Devops integration - environment variables and building tools of Jenkins service
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(八)
NC basic usage 3