PostgreSQL 13.7で直径の値を求めるサンプル

環境
Windows 11 64bit Pro
PostgreSQL 13.7

関数
diameter(circle)
diameter()関数を使って、直径の値を求めます。

使用例1

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
postgres=# select diameter(circle '((0,0),2.0)') result;
result
--------
4
(1)
postgres=# select diameter(circle '((0,0),2.0)') result; result -------- 4 (1 行)
postgres=# select diameter(circle '((0,0),2.0)') result;
 result
--------
      4
(1 行)

使用例2

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
postgres=# select diameter(circle '((0,0),6.0)') result2;
result2
---------
12
(1)
postgres=# select diameter(circle '((0,0),6.0)') result2; result2 --------- 12 (1 行)
postgres=# select diameter(circle '((0,0),6.0)') result2;
 result2
---------
      12
(1 行)

 

PostgreSQL

Posted by arkgame