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
操作別名,僅此而已。