当前位置:网站首页>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
边栏推荐
- Comment créer un pass BEP - 20 sur la chaîne BNB
- The second method of file upload in form form is implemented by fileitem class, servletfileupload class and diskfileitemfactory class.
- How about Bohai futures. Is it safe to open futures accounts?
- What is the difference between a host and a server?
- 记录:调用mapper报空指针;<foreach>不去重的用法;
- An error is reported when sqoop imports data from Mysql to HDFS: sqlexception in nextkeyvalue
- Cadence OrCAD capture batch change component packaging function introduction graphic tutorial and video demonstration
- 山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)
- 中金财富公司怎么样,开户安全吗
- Introduction to link database function of cadence OrCAD capture CIS replacement components, graphic tutorial and video demonstration
猜你喜欢

Building googlenet neural network based on pytorch for flower recognition

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.

CVPR 2022 | querydet: use cascaded sparse query to accelerate small target detection under high resolution

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

山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)

How to protect ECs from hacker attacks?

Servlet learning notes

Comment créer un pass BEP - 20 sur la chaîne BNB

Grafana shares links with variable parameters

LeetCode异或运算
随机推荐
SQL Server Connectors By Thread Pool | DTSQLServerTP 插件使用说明
[target tracking] pedestrian attitude recognition based on frame difference method combined with Kalman filter, with matlab code
Project training of Software College of Shandong University - Innovation Training - network security shooting range experimental platform (V)
山东大学软件学院项目实训-创新实训-网络安全靶场实验平台(六)
R语言ggplot2可视化分面图(facet_wrap)、使用lineheight参数自定义设置分面图标签栏(灰色标签栏)的高度
渤海期货这家公司怎么样。期货开户办理安全?
論文寫作 19: 會議論文與期刊論文的區別
【问题解决】‘ascii‘ codec can‘t encode characters in position xx-xx: ordinal not in range(128)
Paper writing 19: the difference between conference papers and journal papers
CVPR 2022 | querydet: use cascaded sparse query to accelerate small target detection under high resolution
[text classification cases] (4) RNN and LSTM film evaluation Tendency Classification, with tensorflow complete code attached
Mysql database - basic operation of database and table (II)
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
Change the material of unity model as a whole
Markdown < a > tag new page open link
nc基础用法4
Design of warehouse management database system
php参考手册String(7.2千字)
Database query - course selection system
NC basic usage 3