PostgreSQL 13に符号||で文字列を結合する

2022年1月8日

環境
Windows10 64 bit
PostgreSQL 13.2

書式
文字列1 || 文字列2
使用例1

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
postgres=# select 'study' || 'skill' result;
 result
------------
studyskill
(1)
postgres=# select 'study' || 'skill' result;  result ------------ studyskill (1 行)
postgres=# select 'study' || 'skill' result;
   result
------------
 studyskill
(1 行)

使用例2
英字と数字を結合します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
postgres=# select 'study' || 'skill' ||'4567' result;
result
----------------
studyskill4567
(1)
postgres=# select 'study' || 'skill' ||'4567' result; result ---------------- studyskill4567 (1 行)
postgres=# select 'study' || 'skill' ||'4567' result;
     result
----------------
 studyskill4567
(1 行)

 

PostgreSQL

Posted by arkgame