当前位置:网站首页>GBase 8c 字符串操作符
GBase 8c 字符串操作符
2022-07-24 00:16:00 【大壯十二】
GBase 8c 數據庫提供一些字符串操作符,在這些函數裏使用關鍵字而不是逗號來分隔參數。
- octet_length(string)
描述:二進制字符串中的字節數。返回值類型:int
示例:
gbase=# SELECT octet_length(E'jo\\000se'::bytea) AS RESULT;
result
--------
5
(1 row)
- overlay(string placing string from int [for int])
描述:替換子串。返回值類型:bytea
示例:
gbase=# SELECT overlay(E'Th\\000omas'::bytea placing E'\\002\\003'::bytea from 2 for 3) AS RESULT;
result
----------------
\x5402036d6173
(1 row)
- position(substring in string) 描述:特定子字符串的比特置。返回值類型:int
示例:
gbase=# SELECT position(E'\\000om'::bytea in E'Th\\000omas'::bytea) AS RESULT;
result
--------
3
(1 row)
- substring(string [from int] [for int])
描述:截取子串。返回值類型:bytea
示例:
gbase=# SELECT substring(E'Th\\000omas'::bytea from 2 for 3) AS RESULT;
result
----------
\x68006f
(1 row)
- substr(string, from int [, for int])
描述:截取子串。返回值類型:bytea
示例:
gbase=# select substr(E'Th\\000omas'::bytea,2, 3) as result;
result
----------
\x68006f
(1 row)
- trim([both] bytes from string)
描述:從string的開頭和結尾删除只包含bytes中字節的最長字符串。返回值類型:bytea
示例:
gbase=# SELECT trim(E'\\000'::bytea from E'\\000Tom\\000'::bytea) AS RESULT;
result
----------
\x546f6d
(1 row)
边栏推荐
- The differences between text and image drawing, data storage, localstorage, sessionstorage, and cookies
- Scheme for importing XMIND use cases into tapd (with code)
- 力扣刷题训练之超简单
- Codeforces Round #807 (Div. 2)(A-D)
- As a programmer, is there anything you want to say to the newcomer?
- Input and output of ACM mode
- Happiness of progress and growth
- Linked list - 206. Reverse linked list (this question is very important)
- English语法_指示代词 -such / the same
- JMeter中的自动转义处理
猜你喜欢

【译】Go RPC 入门:Hello World

English语法_指示代词 -such / the same

NGFW的Portal认证实验

Tencent cloud was affirmed by international professional streaming media evaluation: video coding performance is the best in all three scenarios

Sum of submatrix

473-82(40、662、31、98、189)

mongodb的多数据源配置

Pipeline pipeline project is built by declarative and jenkinsfile under Jenkins

【微信小程序】拍卖商品详情页设计与交互实现(包含倒计时、实时更新出价)

链表——707. 设计链表
随机推荐
什么是 Restful 动词
kubernetes error
String function 1 of C language
vulnhub wpwn: 1
Automatic escape processing in JMeter
pthread 的 joinable 和 detached
FPGA——SPI总线控制flash(3)含代码
The implementation in Oracle replaces the specified content of the specified column with the desired content
【Android Kotlin】Property、Getter 和 Setter
Intel Intel realsense realistic depth camera self calibration operation steps explanation D400 series is applicable
Space shooting lesson 07: add graphics
Write all the code as soon as you change the test steps? Why not try yaml to realize data-driven?
Cloud native concept
STL case - judges' scoring
高数_第2章多元函数微分学__偏导数的几何应用_空间曲线的切线与法平面
Docker builds sonarqube, mysql5.7 environment
【低代码】低代码发展的局限性
Happiness of progress and growth
mongodb的多数据源配置
vulnhub wpwn: 1