6
SELECT DISTINCT a.profn FROM tprof a, sap_tstc b, tgrc c
WHERE ((c.grcid ~~ a.grcid)
AND ((c.tcode) = (b.tcode)));
什么是~~
是什么意思?
SELECT DISTINCT a.profn FROM tprof a, sap_tstc b, tgrc c
WHERE ((c.grcid ~~ a.grcid)
AND ((c.tcode) = (b.tcode)));
什么是~~
是什么意思?
从PostgreSQL文档的9.7.1. LIKE:
操作
~~
相当于LIKE
,和~~*
对应于ILIKE
。还有!~~
和!~~*
运营商,分别代表NOT LIKE
和NOT ILIKE
。 所有这些运算符都是特定于PostgreSQL的。
它没有列在index of the documentation这令人沮丧。
所以我有psql
一看:
regress=> \do ~~
List of operators
Schema | Name | Left arg type | Right arg type | Result type | Description
------------+------+---------------+----------------+-------------+-------------------------
pg_catalog | ~~ | bytea | bytea | boolean | matches LIKE expression
pg_catalog | ~~ | character | text | boolean | matches LIKE expression
pg_catalog | ~~ | name | text | boolean | matches LIKE expression
pg_catalog | ~~ | text | text | boolean | matches LIKE expression
(4 rows)
这对LIKE
操作别名,仅此而已。