最近の記事

Homebrewのインストールでいろいろやったこと   Python編

実行環境:Apple M1 Pro macOS Ventura 13.2 ターミナル -bash 自分は、brew:   command not fond と表示されたので を実行した。下記のエラーが出て結果はできなかった。 xcrun: error: unable to load libxcrun ここからいろいろいじってみた。以前Visual StudioをインストールしてPythonの勉強したりしていたのでその環境を綺麗に消してみた。 いろいろググると、Xco

    • INNER JOIN構文 testdb=# \d member Table test.member test.departmen

      testdb=# SELECT * FROM member; no | name | tel | groupno ----+------+-------------+--------- 1 | 石川 | 01201234567 | 2 2 | 鈴木 | 01201234568 | 3 3 | 児玉 | 01201234569 | 2(3 rows) testdb=# SELECT * FROM department;

      • testdb=# \z itemとREVOKE

        testdb=# \z item Access privileges Schema | Name | Type | Access privileges | Column privileges | Policies --------+------+-------+---------------------------+-------------------+---------- public | i

        • 集合演算は和集合 testdb=# \d projectA public.projecta public.projectb

          testdb=# \d projectA Table "public.projecta" Column | Type | Collation | Nullable | Default --------+-------------------+-----------+----------+--------- member | character varying | | |

          NULLを渡すと処理を実行せずにNULLを返す testdb=# \d Table func1.sample

          testdb=# \df List of functions Schema | Name | Result data type | Argument data types | Type --------+-----------------+------------------+---------------------+------ func1 | sample_func | SETOF i

          NULLを渡すと処理を実行せずにNULLを返す testdb=# \d Table func1.sample

          NATURAL FULL OUTER JOIN testdb=# \d public.testdb public.department

          testdb=# SELECT * FROM member; no | name | tel | groupno | boss ----+------+------------+---------+-------- 1 | 佐藤 | 1201234567 | 2 | 佐々木 2 | 鈴木 | 1201234568 | 1 | 原田 3 | 渡辺 | 1201234569 | 4 | 天野(3 rows) testd

          NATURAL FULL OUTER JOIN testdb=# \d public.testdb public.department

          LEFT OUTER JOIN testdb=# \d test.member test.department

          testdb=# SELECT * FROM member; no | name | tel | groupno ----+------+-------------+--------- 1 | 石川 | 01201234567 | 2 2 | 鈴木 | 01201234568 | 3 3 | 児玉 | 01201234569 | 2(3 rows) testdb=# SELECT * FROM department;

          LEFT OUTER JOIN testdb=# \d test.member test.department

          examdb=# \d test1.sample1 test1.sample2 INHERITSコマンド

          examdb=# \d sample1; Table "test1.sample1" Column | Type | Collation | Nullable | Default --------+-----------------------+-----------+----------+--------- no | integer | |

          examdb=# \d test1.sample1 test1.sample2 INHERITSコマンド

          FULL OUTER JOIN

          testdb=# \d member Table "public.member" Column | Type | Collation | Nullable | Default ---------+---------+-----------+----------+------------------------------------ no | int

          FULL OUTER JOIN

          EXISTSとNOT EXISTS その2

          testdb=# \d zooA Table "public.zooa" Column | Type | Collation | Nullable | Default --------+---------+-----------+----------+--------- name | text | | | num | integer | | |

          EXISTSとNOT EXISTS その2

          NULLを返す関数を呼ぶトリガーを作成

          testdb=# \df List of functions Schema | Name | Result data type | Argument data types | Type --------+-----------------+------------------+---------------------+------ public | log_time_writer | trigger

          NULLを返す関数を呼ぶトリガーを作成

          RIGHT OUTER JOIN postgres=# \d shopa_shoes postgres=# \d shopb_shoes

          postgres=# \d shopa_shoes Table "public.shopa_shoes" Column | Type | Collation | Nullable | Default --------+-------------------+-----------+----------+-----------

          RIGHT OUTER JOIN postgres=# \d shopa_shoes postgres=# \d shopb_shoes

          Table "test.member" "test.department" OUTER JOIN句

          testdb=# \d member Table "test.member" Column | Type | Collation | Nullable | Default ---------+-----------------------+-----------+----------+--------- no | integer | |

          Table "test.member" "test.department" OUTER JOIN句

          組み込み関数

          testdb=# SELECT extract(minute from now()); date_part ----------- 37(1 row) testdb=# SELECT date_part('minute', current_timestamp); date_part ----------- 38(1 row) 現在の日時 testdb=# SELECT statement_timestamp(); statement

          組み込み関数

          testdb=# \d test.sample ユニーク制約

          testdb=# \d sample Table "test.sample" Column | Type | Collation | Nullable | Default -----------+---------+-----------+----------+---------------- id | integer | | not null | name | t

          testdb=# \d test.sample ユニーク制約

          postgres=# \d menber Table "test.member"

          postgres=# \d member Table "test.member" Column | Type | Collation | Nullable | Default --------+-------------------+-----------+----------+--------- id | character varying | | | name

          postgres=# \d menber Table "test.member"