mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-03 00:56:53 +02:00
88 lines
3.1 KiB
Plaintext
88 lines
3.1 KiB
Plaintext
drop table 計算機용어;
|
|
ERROR: Relation '計算機용어' does not exist
|
|
create table 計算機용어 (용어 text, 分類코드 varchar, 비고1A라구 char(16));
|
|
create index 計算機용어index1 on 計算機용어 using btree (용어);
|
|
create index 計算機용어index2 on 計算機용어 using hash (分類코드);
|
|
insert into 計算機용어 values('컴퓨터디스플레이', '機A01上');
|
|
insert into 計算機용어 values('컴퓨터그래픽스', '分B10中');
|
|
insert into 計算機용어 values('컴퓨터프로그래머', '人Z01下');
|
|
vacuum 計算機용어;
|
|
select * from 計算機용어;
|
|
용어 | 分類코드 | 비고1a라구
|
|
------------------+----------+------------
|
|
컴퓨터디스플레이 | 機A01上 |
|
|
컴퓨터그래픽스 | 分B10中 |
|
|
컴퓨터프로그래머 | 人Z01下 |
|
|
(3 rows)
|
|
|
|
select * from 計算機용어 where 分類코드 = '人Z01下';
|
|
용어 | 分類코드 | 비고1a라구
|
|
------------------+----------+------------
|
|
컴퓨터프로그래머 | 人Z01下 |
|
|
(1 row)
|
|
|
|
select * from 計算機용어 where 分類코드 ~* '人z01下';
|
|
용어 | 分類코드 | 비고1a라구
|
|
------------------+----------+------------
|
|
컴퓨터프로그래머 | 人Z01下 |
|
|
(1 row)
|
|
|
|
select * from 計算機용어 where 分類코드 like '_Z01_';
|
|
용어 | 分類코드 | 비고1a라구
|
|
------------------+----------+------------
|
|
컴퓨터프로그래머 | 人Z01下 |
|
|
(1 row)
|
|
|
|
select * from 計算機용어 where 分類코드 like '_Z%';
|
|
용어 | 分類코드 | 비고1a라구
|
|
------------------+----------+------------
|
|
컴퓨터프로그래머 | 人Z01下 |
|
|
(1 row)
|
|
|
|
select * from 計算機용어 where 용어 ~ '컴퓨터[디그]';
|
|
용어 | 分類코드 | 비고1a라구
|
|
------------------+----------+------------
|
|
컴퓨터디스플레이 | 機A01上 |
|
|
컴퓨터그래픽스 | 分B10中 |
|
|
(2 rows)
|
|
|
|
select * from 計算機용어 where 용어 ~* '컴퓨터[디그]';
|
|
용어 | 分類코드 | 비고1a라구
|
|
------------------+----------+------------
|
|
컴퓨터디스플레이 | 機A01上 |
|
|
컴퓨터그래픽스 | 分B10中 |
|
|
(2 rows)
|
|
|
|
select *,character_length(용어) from 計算機용어;
|
|
용어 | 分類코드 | 비고1a라구 | char_length
|
|
------------------+----------+------------+-------------
|
|
컴퓨터디스플레이 | 機A01上 | | 8
|
|
컴퓨터그래픽스 | 分B10中 | | 7
|
|
컴퓨터프로그래머 | 人Z01下 | | 8
|
|
(3 rows)
|
|
|
|
select *,octet_length(용어) from 計算機용어;
|
|
용어 | 分類코드 | 비고1a라구 | octet_length
|
|
------------------+----------+------------+--------------
|
|
컴퓨터디스플레이 | 機A01上 | | 16
|
|
컴퓨터그래픽스 | 分B10中 | | 14
|
|
컴퓨터프로그래머 | 人Z01下 | | 16
|
|
(3 rows)
|
|
|
|
select *,position('디' in 용어) from 計算機용어;
|
|
용어 | 分類코드 | 비고1a라구 | strpos
|
|
------------------+----------+------------+--------
|
|
컴퓨터디스플레이 | 機A01上 | | 4
|
|
컴퓨터그래픽스 | 分B10中 | | 0
|
|
컴퓨터프로그래머 | 人Z01下 | | 0
|
|
(3 rows)
|
|
|
|
select *,substring(용어 from 3 for 4) from 計算機용어;
|
|
용어 | 分類코드 | 비고1a라구 | substr
|
|
------------------+----------+------------+----------
|
|
컴퓨터디스플레이 | 機A01上 | | 터디스플
|
|
컴퓨터그래픽스 | 分B10中 | | 터그래픽
|
|
컴퓨터프로그래머 | 人Z01下 | | 터프로그
|
|
(3 rows)
|
|
|