当前位置:网站首页>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
边栏推荐
- Redis distributed lock
- 如何在BNB鏈上創建BEP-20通證
- PHP reference manual string (7.2000 words)
- Investigate why close is required after sqlsession is used in mybatties
- Design of library management database system
- Mysql database - single table query (I)
- [problem solving] 'ASCII' codec can't encode characters in position XX XX: ordinal not in range (128)
- How to do product innovation—— Exploration of product innovation methodology I
- Unity 模型整体更改材质
- Computing the intersection of two planes in PCL point cloud processing (51)
猜你喜欢
【文本分类案例】(4) RNN、LSTM 电影评价倾向分类,附TensorFlow完整代码
Kubernetes entry to mastery - bare metal loadbalance 80 443 port exposure precautions
STM32 Basics
Openharmony open source developer growth plan, looking for new open source forces that change the world!
PHP reference manual string (7.2000 words)
PIP installation package reports an error. Could not find a version that satisfies the requirement pymysql (from versions: none)
AQS learning
[talkative cloud native] load balancing - the passenger flow of small restaurants has increased
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)
WordPress plug-in: WP CHINA Yes solution to slow domestic access to the official website
随机推荐
【目标跟踪】基于帧差法结合卡尔曼滤波实现行人姿态识别附matlab代码
Investigate why close is required after sqlsession is used in mybatties
nc基础用法3
Still using listview? Use animatedlist to make list elements move
Electron入门教程3 ——进程通信
CVPR 2022 | querydet: use cascaded sparse query to accelerate small target detection under high resolution
还在用 ListView?使用 AnimatedList 让列表元素动起来
JDBC tool class jdbcfiledateutil uploads files and date format conversion, including the latest, simplest and easiest way to upload single files and multiple files
Fundamentals of programming language (2)
Redis installation (centos7 command line installation)
Cadence OrCAD capture batch change component packaging function introduction graphic tutorial and video demonstration
如何做产品创新?——产品创新方法论探索一
STM32 Basics
SIGIR'22「微软」CTR估计:利用上下文信息促进特征表征学习
The second method of file upload in form form is implemented by fileitem class, servletfileupload class and diskfileitemfactory class.
Understanding various team patterns in scrum patterns
How about Bohai futures. Is it safe to open futures accounts?
Livego + ffmpeg + RTMP + flvjs to realize live video
中金财富公司怎么样,开户安全吗
Leetcode dynamic planning training camp (1-5 days)