当前位置:网站首页>瀚高数据库自定义操作符‘!~~‘
瀚高数据库自定义操作符‘!~~‘
2022-06-26 05:05:00 【瀚高PG实验室】
瀚高数据库
目录
环境
文档用途
详细信息
环境
系统平台:Microsoft Windows (64-bit) 10
版本:5.6.5
文档用途
解决应用程序中SQL语句使用!~~匹配操作符时,遇到的错误:
ERROR: 42883: operator does not exist: integer !~~ integer
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
详细信息
一,测试准备
创建表并插入数据:
create TABLE oper_test(first_num int);
insert into oper_test values(234),(446),(467);
二,测试查询
select (446 !~~ first_num) newlist from oper_test;

三,解决方案:自定义操作符
CREATE OR REPLACE FUNCTION hgdb_catalog.intnlike(integer,integer)
RETURNS boolean AS $$
select $1::varchar !~~ $2::varchar;
$$
LANGUAGE sql strict;
ALTER FUNCTION intnlike(integer, integer)
OWNER TO highgo;
COMMENT ON FUNCTION intnlike(integer,integer) IS 'implementation of !~~ operator';
create operator hgdb_catalog.!~~(
procedure = hgdb_catalog.intnlike,
leftarg = integer,
rightarg = integer
);
四,再次查询

边栏推荐
- Why do many Shopify independent station sellers use chat robots? Read industry secrets in one minute!
- 5. <tag-栈和常规问题>补充: lt.946. 验证栈序列(同剑指 Offer 31. 栈的压入、弹出序列)
- How MySQL deletes all redundant duplicate data
- Datetime data type ---now() gets the current time, datetime() creation date, performs mathematical operations, and to_ Datetime() converts to date type and extracts various parts of date
- MySql如何删除所有多余的重复数据
- YOLOV5训练结果的解释
- date_ Range creation date range freq parameter value table and creation example
- 86. (cesium chapter) cesium overlay surface receiving shadow effect (gltf model)
- torchvision_ Transform (image enhancement)
- [quartz] read configuration from database to realize dynamic timing task
猜你喜欢

A method of quickly transplanting library function code to register code by single chip microcomputer

UWB超高精度定位系统架构图

广和通联合安提国际为基于英伟达 Jetson Xavier NX的AI边缘计算平台带来5G R16强大性能

UWB超高精度定位系统原理图

【Unity3D】人机交互Input

Learn from small samples and run to the sea of stars

Why do many Shopify independent station sellers use chat robots? Read industry secrets in one minute!

FastAdmin Apache下设置伪静态

关于支付接口回调地址参数字段是“notify_url”,签名过后的特殊字符url编码以后再解码后出现错误(¬ , ¢, ¤, £)

Decipher the AI black technology behind sports: figure skating action recognition, multi-mode video classification and wonderful clip editing
随机推荐
RESNET practice in tensorflow
GD32F3x0 官方PWM驱动正频宽偏小(定时不准)的问题
ECCV 2020 double champion team, take you to conquer target detection on the 7th
Classic theory: detailed explanation of three handshakes and four waves of TCP protocol
Pycharm package import error without warning
2022.2.16
Resample
Technical problems to be faced in mobile terminal im development
MySql如何删除所有多余的重复数据
Cookie and session Basics
Collections and dictionaries
Codeforces Round #800 (Div. 2)
天才制造者:獨行俠、科技巨頭和AI|深度學習崛起十年
Ai+ remote sensing: releasing the value of each pixel
2022.2.13
C# 39. string类型和byte[]类型相互转换(实测)
5. <tag-栈和常规问题>补充: lt.946. 验证栈序列(同剑指 Offer 31. 栈的压入、弹出序列)
PowerShell runtime system IO exceptions
First day of deep learning and tensorflow learning
[latex] error type summary (hold the change)