examdb=# \d sample Table "test4.sample"
examdb=# \d sample
Table "test4.sample"
Column | Type | Collation | Nullable | Default
--------+-----------------------+-----------+----------+---------
id | integer | | |
name | character varying(10) | | |
tel | character(11) | | |
examdb=# SELECT * FROM sample;
id | name | tel
----+--------+-------------
1 | SATO | 09011111111
2 | toda | 09022222222
3 | sato | 09033333333
4 | TODA | 09044444444
5 | TANAKA | 09055555555
(5 rows)
examdb=# UPDATE sample SET tel = NULL WHERE name !~* 'TO';
UPDATE 1
examdb=# SELECT * FROM sample;
id | name | tel
----+--------+-------------
1 | SATO | 09011111111
2 | toda | 09022222222
3 | sato | 09033333333
4 | TODA | 09044444444
5 | TANAKA |
(5 rows)
この記事が気に入ったらサポートをしてみませんか?