Commit 805e0c45 authored by Tatsuo Ishii's avatar Tatsuo Ishii

Fixes for char_length() changes.

parent d14c8aab
drop table 廠商資料 drop table 廠商資料;
create table 廠商資料 (行業別 text, 公司抬頭 varchar, 地址 varchar(16)) create table 廠商資料 (行業別 text, 公司抬頭 varchar, 地址 varchar(16));
create index 廠商資料index1 on 廠商資料 using btree (行業別) create index 廠商資料index1 on 廠商資料 using btree (行業別);
create index 廠商資料index2 on 廠商資料 using hash (公司抬頭) create index 廠商資料index2 on 廠商資料 using hash (公司抬頭);
insert into 廠商資料 values ('電腦業', '達達科技', '北A01仁') insert into 廠商資料 values ('電腦業', '達達科技', '北A01仁');
insert into 廠商資料 values ('製造業', '財源有限公司', '中B10中') insert into 廠商資料 values ('製造業', '財源有限公司', '中B10中');
insert into 廠商資料 values ('餐飲業', '美味股份有限公司', '高Z01九') insert into 廠商資料 values ('餐飲業', '美味股份有限公司', '高Z01九');
vacuum 廠商資料 vacuum 廠商資料;
select * from 廠商資料 select * from 廠商資料;
行業別 | 公司抬頭 | 地址 行業別 | 公司抬頭 | 地址
--------+------------------+--------- --------+------------------+---------
電腦業 | 達達科技 | 北A01仁 電腦業 | 達達科技 | 北A01仁
...@@ -14,51 +14,51 @@ select * from ...@@ -14,51 +14,51 @@ select * from
餐飲業 | 美味股份有限公司 | 高Z01九 餐飲業 | 美味股份有限公司 | 高Z01九
(3 rows) (3 rows)
select * from 廠商資料 where 地址 = '高Z01九' select * from 廠商資料 where 地址 = '高Z01九';
行業別 | 公司抬頭 | 地址 行業別 | 公司抬頭 | 地址
--------+------------------+--------- --------+------------------+---------
餐飲業 | 美味股份有限公司 | 高Z01九 餐飲業 | 美味股份有限公司 | 高Z01九
(1 row) (1 row)
select * from 廠商資料 where 地址 ~* '高z01九' select * from 廠商資料 where 地址 ~* '高z01九';
行業別 | 公司抬頭 | 地址 行業別 | 公司抬頭 | 地址
--------+------------------+--------- --------+------------------+---------
餐飲業 | 美味股份有限公司 | 高Z01九 餐飲業 | 美味股份有限公司 | 高Z01九
(1 row) (1 row)
select * from 廠商資料 where 地址 like '_Z01_' select * from 廠商資料 where 地址 like '_Z01_';
行業別 | 公司抬頭 | 地址 行業別 | 公司抬頭 | 地址
--------+------------------+--------- --------+------------------+---------
餐飲業 | 美味股份有限公司 | 高Z01九 餐飲業 | 美味股份有限公司 | 高Z01九
(1 row) (1 row)
select * from 廠商資料 where 地址 like '_Z%' select * from 廠商資料 where 地址 like '_Z%';
行業別 | 公司抬頭 | 地址 行業別 | 公司抬頭 | 地址
--------+------------------+--------- --------+------------------+---------
餐飲業 | 美味股份有限公司 | 高Z01九 餐飲業 | 美味股份有限公司 | 高Z01九
(1 row) (1 row)
select * from 廠商資料 where 公司抬頭 ~ '達達科[寄記技]' select * from 廠商資料 where 公司抬頭 ~ '達達科[寄記技]';
行業別 | 公司抬頭 | 地址 行業別 | 公司抬頭 | 地址
--------+----------+--------- --------+----------+---------
電腦業 | 達達科技 | 北A01仁 電腦業 | 達達科技 | 北A01仁
(1 row) (1 row)
select * from 廠商資料 where 公司抬頭 ~* '達達科[寄記技]' select * from 廠商資料 where 公司抬頭 ~* '達達科[寄記技]';
行業別 | 公司抬頭 | 地址 行業別 | 公司抬頭 | 地址
--------+----------+--------- --------+----------+---------
電腦業 | 達達科技 | 北A01仁 電腦業 | 達達科技 | 北A01仁
(1 row) (1 row)
select *, character_length(行業別) from 廠商資料 select *, character_length(行業別) from 廠商資料;
行業別 | 公司抬頭 | 地址 | length 行業別 | 公司抬頭 | 地址 | char_length
--------+------------------+---------+-------- --------+------------------+---------+-------------
電腦業 | 達達科技 | 北A01仁 | 3 電腦業 | 達達科技 | 北A01仁 | 3
製造業 | 財源有限公司 | 中B10中 | 3 製造業 | 財源有限公司 | 中B10中 | 3
餐飲業 | 美味股份有限公司 | 高Z01九 | 3 餐飲業 | 美味股份有限公司 | 高Z01九 | 3
(3 rows) (3 rows)
select *, octet_length(行業別) from 廠商資料 select *, octet_length(行業別) from 廠商資料;
行業別 | 公司抬頭 | 地址 | octet_length 行業別 | 公司抬頭 | 地址 | octet_length
--------+------------------+---------+-------------- --------+------------------+---------+--------------
電腦業 | 達達科技 | 北A01仁 | 6 電腦業 | 達達科技 | 北A01仁 | 6
...@@ -66,7 +66,7 @@ select *, octet_length( ...@@ -66,7 +66,7 @@ select *, octet_length(
餐飲業 | 美味股份有限公司 | 高Z01九 | 6 餐飲業 | 美味股份有限公司 | 高Z01九 | 6
(3 rows) (3 rows)
select *, position('有限' in 公司抬頭) from 廠商資料 select *, position('有限' in 公司抬頭) from 廠商資料;
行業別 | 公司抬頭 | 地址 | strpos 行業別 | 公司抬頭 | 地址 | strpos
--------+------------------+---------+-------- --------+------------------+---------+--------
電腦業 | 達達科技 | 北A01仁 | 0 電腦業 | 達達科技 | 北A01仁 | 0
...@@ -74,7 +74,7 @@ select *, position(' ...@@ -74,7 +74,7 @@ select *, position('
餐飲業 | 美味股份有限公司 | 高Z01九 | 5 餐飲業 | 美味股份有限公司 | 高Z01九 | 5
(3 rows) (3 rows)
select *, substring(公司抬頭 from 3 for 6 ) from 廠商資料 select *, substring(公司抬頭 from 3 for 6 ) from 廠商資料;
行業別 | 公司抬頭 | 地址 | substr 行業別 | 公司抬頭 | 地址 | substr
--------+------------------+---------+-------------- --------+------------------+---------+--------------
電腦業 | 達達科技 | 北A01仁 | 科技 電腦業 | 達達科技 | 北A01仁 | 科技
......
drop table 计算机术语 drop table 计算机术语;
ERROR: Relation '计算机术语' does not exist ERROR: Relation '计算机术语' does not exist
create table 计算机术语(术语 text, 分类号 varchar, 备注1A char(16)) create table 计算机术语(术语 text, 分类号 varchar, 备注1A char(16));
create index 计算机术语index1 on 计算机术语 using btree(术语) create index 计算机术语index1 on 计算机术语 using btree(术语);
create index 计算机术语index2 on 计算机术语 using btree(分类号) create index 计算机术语index2 on 计算机术语 using btree(分类号);
insert into 计算机术语 values('电脑显示屏','机A01上') insert into 计算机术语 values('电脑显示屏','机A01上');
insert into 计算机术语 values('电脑图形','分B01中') insert into 计算机术语 values('电脑图形','分B01中');
insert into 计算机术语 values('电脑程序员','人Z01下') insert into 计算机术语 values('电脑程序员','人Z01下');
vacuum 计算机术语 vacuum 计算机术语;
select * from 计算机术语 select * from 计算机术语;
术语 | 分类号 | 备注1a 术语 | 分类号 | 备注1a
------------+---------+-------- ------------+---------+--------
电脑显示屏 | 机A01上 | 电脑显示屏 | 机A01上 |
...@@ -15,53 +15,53 @@ select * from ...@@ -15,53 +15,53 @@ select * from
电脑程序员 | 人Z01下 | 电脑程序员 | 人Z01下 |
(3 rows) (3 rows)
select * from 计算机术语 where 分类号 = '人Z01下' select * from 计算机术语 where 分类号 = '人Z01下';
术语 | 分类号 | 备注1a 术语 | 分类号 | 备注1a
------------+---------+-------- ------------+---------+--------
电脑程序员 | 人Z01下 | 电脑程序员 | 人Z01下 |
(1 row) (1 row)
select * from 计算机术语 where 分类号 ~* '人z01下' select * from 计算机术语 where 分类号 ~* '人z01下';
术语 | 分类号 | 备注1a 术语 | 分类号 | 备注1a
------------+---------+-------- ------------+---------+--------
电脑程序员 | 人Z01下 | 电脑程序员 | 人Z01下 |
(1 row) (1 row)
select * from 计算机术语 where 分类号 like '_Z01_' select * from 计算机术语 where 分类号 like '_Z01_';
术语 | 分类号 | 备注1a 术语 | 分类号 | 备注1a
------------+---------+-------- ------------+---------+--------
电脑程序员 | 人Z01下 | 电脑程序员 | 人Z01下 |
(1 row) (1 row)
select * from 计算机术语 where 分类号 like '_Z%' select * from 计算机术语 where 分类号 like '_Z%';
术语 | 分类号 | 备注1a 术语 | 分类号 | 备注1a
------------+---------+-------- ------------+---------+--------
电脑程序员 | 人Z01下 | 电脑程序员 | 人Z01下 |
(1 row) (1 row)
select * from 计算机术语 where 术语 ~ '电脑[显图]' select * from 计算机术语 where 术语 ~ '电脑[显图]';
术语 | 分类号 | 备注1a 术语 | 分类号 | 备注1a
------------+---------+-------- ------------+---------+--------
电脑显示屏 | 机A01上 | 电脑显示屏 | 机A01上 |
电脑图形 | 分B01中 | 电脑图形 | 分B01中 |
(2 rows) (2 rows)
select * from 计算机术语 where 术语 ~* '电脑[显图]' select * from 计算机术语 where 术语 ~* '电脑[显图]';
术语 | 分类号 | 备注1a 术语 | 分类号 | 备注1a
------------+---------+-------- ------------+---------+--------
电脑显示屏 | 机A01上 | 电脑显示屏 | 机A01上 |
电脑图形 | 分B01中 | 电脑图形 | 分B01中 |
(2 rows) (2 rows)
select *,character_length(术语) from 计算机术语 select *,character_length(术语) from 计算机术语;
术语 | 分类号 | 备注1a | length 术语 | 分类号 | 备注1a | char_length
------------+---------+--------+-------- ------------+---------+--------+-------------
电脑显示屏 | 机A01上 | | 5 电脑显示屏 | 机A01上 | | 5
电脑图形 | 分B01中 | | 4 电脑图形 | 分B01中 | | 4
电脑程序员 | 人Z01下 | | 5 电脑程序员 | 人Z01下 | | 5
(3 rows) (3 rows)
select *,octet_length(术语) from 计算机术语 select *,octet_length(术语) from 计算机术语;
术语 | 分类号 | 备注1a | octet_length 术语 | 分类号 | 备注1a | octet_length
------------+---------+--------+-------------- ------------+---------+--------+--------------
电脑显示屏 | 机A01上 | | 10 电脑显示屏 | 机A01上 | | 10
...@@ -69,7 +69,7 @@ select *,octet_length( ...@@ -69,7 +69,7 @@ select *,octet_length(
电脑程序员 | 人Z01下 | | 10 电脑程序员 | 人Z01下 | | 10
(3 rows) (3 rows)
select *,position('显' in 术语) from 计算机术语 select *,position('显' in 术语) from 计算机术语;
术语 | 分类号 | 备注1a | strpos 术语 | 分类号 | 备注1a | strpos
------------+---------+--------+-------- ------------+---------+--------+--------
电脑显示屏 | 机A01上 | | 3 电脑显示屏 | 机A01上 | | 3
...@@ -77,7 +77,7 @@ select *,position(' ...@@ -77,7 +77,7 @@ select *,position('
电脑程序员 | 人Z01下 | | 0 电脑程序员 | 人Z01下 | | 0
(3 rows) (3 rows)
select *,substring(术语 from 3 for 4) from 计算机术语 select *,substring(术语 from 3 for 4) from 计算机术语;
术语 | 分类号 | 备注1a | substr 术语 | 分类号 | 备注1a | substr
------------+---------+--------+-------- ------------+---------+--------+--------
电脑显示屏 | 机A01上 | | 显示屏 电脑显示屏 | 机A01上 | | 显示屏
......
drop table 計算機用語 drop table 計算機用語;
ERROR: Relation '計算機用語' does not exist ERROR: Relation '計算機用語' does not exist
create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16)) create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16));
create index 計算機用語index1 on 計算機用語 using btree (用語) create index 計算機用語index1 on 計算機用語 using btree (用語);
create index 計算機用語index2 on 計算機用語 using hash (分類コード) create index 計算機用語index2 on 計算機用語 using hash (分類コード);
insert into 計算機用語 values('コンピュータディスプレイ','機A01上') insert into 計算機用語 values('コンピュータディスプレイ','機A01上');
insert into 計算機用語 values('コンピュータグラフィックス','分B10中') insert into 計算機用語 values('コンピュータグラフィックス','分B10中');
insert into 計算機用語 values('コンピュータプログラマー','人Z01下') insert into 計算機用語 values('コンピュータプログラマー','人Z01下');
vacuum 計算機用語 vacuum 計算機用語;
select * from 計算機用語 select * from 計算機用語;
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
----------------------------+------------+------------ ----------------------------+------------+------------
コンピュータディスプレイ | 機A01上 | コンピュータディスプレイ | 機A01上 |
...@@ -15,53 +15,53 @@ select * from ...@@ -15,53 +15,53 @@ select * from
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(3 rows) (3 rows)
select * from 計算機用語 where 分類コード = '人Z01下' select * from 計算機用語 where 分類コード = '人Z01下';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
--------------------------+------------+------------ --------------------------+------------+------------
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(1 row) (1 row)
select * from 計算機用語 where 分類コード ~* '人z01下' select * from 計算機用語 where 分類コード ~* '人z01下';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
--------------------------+------------+------------ --------------------------+------------+------------
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(1 row) (1 row)
select * from 計算機用語 where 分類コード like '_Z01_' select * from 計算機用語 where 分類コード like '_Z01_';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
--------------------------+------------+------------ --------------------------+------------+------------
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(1 row) (1 row)
select * from 計算機用語 where 分類コード like '_Z%' select * from 計算機用語 where 分類コード like '_Z%';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
--------------------------+------------+------------ --------------------------+------------+------------
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(1 row) (1 row)
select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]' select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
----------------------------+------------+------------ ----------------------------+------------+------------
コンピュータディスプレイ | 機A01上 | コンピュータディスプレイ | 機A01上 |
コンピュータグラフィックス | 分B10中 | コンピュータグラフィックス | 分B10中 |
(2 rows) (2 rows)
select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]' select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
----------------------------+------------+------------ ----------------------------+------------+------------
コンピュータディスプレイ | 機A01上 | コンピュータディスプレイ | 機A01上 |
コンピュータグラフィックス | 分B10中 | コンピュータグラフィックス | 分B10中 |
(2 rows) (2 rows)
select *,character_length(用語) from 計算機用語 select *,character_length(用語) from 計算機用語;
用語 | 分類コード | 備考1aだよ | length 用語 | 分類コード | 備考1aだよ | char_length
----------------------------+------------+------------+-------- ----------------------------+------------+------------+-------------
コンピュータディスプレイ | 機A01上 | | 12 コンピュータディスプレイ | 機A01上 | | 12
コンピュータグラフィックス | 分B10中 | | 13 コンピュータグラフィックス | 分B10中 | | 13
コンピュータプログラマー | 人Z01下 | | 12 コンピュータプログラマー | 人Z01下 | | 12
(3 rows) (3 rows)
select *,octet_length(用語) from 計算機用語 select *,octet_length(用語) from 計算機用語;
用語 | 分類コード | 備考1aだよ | octet_length 用語 | 分類コード | 備考1aだよ | octet_length
----------------------------+------------+------------+-------------- ----------------------------+------------+------------+--------------
コンピュータディスプレイ | 機A01上 | | 24 コンピュータディスプレイ | 機A01上 | | 24
...@@ -69,7 +69,7 @@ select *,octet_length( ...@@ -69,7 +69,7 @@ select *,octet_length(
コンピュータプログラマー | 人Z01下 | | 24 コンピュータプログラマー | 人Z01下 | | 24
(3 rows) (3 rows)
select *,position('デ' in 用語) from 計算機用語 select *,position('デ' in 用語) from 計算機用語;
用語 | 分類コード | 備考1aだよ | strpos 用語 | 分類コード | 備考1aだよ | strpos
----------------------------+------------+------------+-------- ----------------------------+------------+------------+--------
コンピュータディスプレイ | 機A01上 | | 7 コンピュータディスプレイ | 機A01上 | | 7
...@@ -77,7 +77,7 @@ select *,position(' ...@@ -77,7 +77,7 @@ select *,position('
コンピュータプログラマー | 人Z01下 | | 0 コンピュータプログラマー | 人Z01下 | | 0
(3 rows) (3 rows)
select *,substring(用語 from 10 for 4) from 計算機用語 select *,substring(用語 from 10 for 4) from 計算機用語;
用語 | 分類コード | 備考1aだよ | substr 用語 | 分類コード | 備考1aだよ | substr
----------------------------+------------+------------+---------- ----------------------------+------------+------------+----------
コンピュータディスプレイ | 機A01上 | | プレイ コンピュータディスプレイ | 機A01上 | | プレイ
......
drop table 計算機용어 drop table 計算機용어;
ERROR: Relation '計算機용어' does not exist ERROR: Relation '計算機용어' does not exist
create table 計算機용어 (용어 text, 分類코드 varchar, 비고1A라구 char(16)) create table 計算機용어 (용어 text, 分類코드 varchar, 비고1A라구 char(16));
create index 計算機용어index1 on 計算機용어 using btree (용어) create index 計算機용어index1 on 計算機용어 using btree (용어);
create index 計算機용어index2 on 計算機용어 using hash (分類코드) create index 計算機용어index2 on 計算機용어 using hash (分類코드);
insert into 計算機용어 values('컴퓨터디스플레이', '機A01上') insert into 計算機용어 values('컴퓨터디스플레이', '機A01上');
insert into 計算機용어 values('컴퓨터그래픽스', '分B10中') insert into 計算機용어 values('컴퓨터그래픽스', '分B10中');
insert into 計算機용어 values('컴퓨터프로그래머', '人Z01下') insert into 計算機용어 values('컴퓨터프로그래머', '人Z01下');
vacuum 計算機용어 vacuum 計算機용어;
select * from 計算機용어 select * from 計算機용어;
용어 | 分類코드 | 비고1a라구 용어 | 分類코드 | 비고1a라구
------------------+----------+------------ ------------------+----------+------------
컴퓨터디스플레이 | 機A01上 | 컴퓨터디스플레이 | 機A01上 |
...@@ -15,53 +15,53 @@ select * from 計算機 ...@@ -15,53 +15,53 @@ select * from 計算機
컴퓨터프로그래머 | 人Z01下 | 컴퓨터프로그래머 | 人Z01下 |
(3 rows) (3 rows)
select * from 計算機용어 where 分類코드 = '人Z01下' select * from 計算機용어 where 分類코드 = '人Z01下';
용어 | 分類코드 | 비고1a라구 용어 | 分類코드 | 비고1a라구
------------------+----------+------------ ------------------+----------+------------
컴퓨터프로그래머 | 人Z01下 | 컴퓨터프로그래머 | 人Z01下 |
(1 row) (1 row)
select * from 計算機용어 where 分類코드 ~* '人z01下' select * from 計算機용어 where 分類코드 ~* '人z01下';
용어 | 分類코드 | 비고1a라구 용어 | 分類코드 | 비고1a라구
------------------+----------+------------ ------------------+----------+------------
컴퓨터프로그래머 | 人Z01下 | 컴퓨터프로그래머 | 人Z01下 |
(1 row) (1 row)
select * from 計算機용어 where 分類코드 like '_Z01_' select * from 計算機용어 where 分類코드 like '_Z01_';
용어 | 分類코드 | 비고1a라구 용어 | 分類코드 | 비고1a라구
------------------+----------+------------ ------------------+----------+------------
컴퓨터프로그래머 | 人Z01下 | 컴퓨터프로그래머 | 人Z01下 |
(1 row) (1 row)
select * from 計算機용어 where 分類코드 like '_Z%' select * from 計算機용어 where 分類코드 like '_Z%';
용어 | 分類코드 | 비고1a라구 용어 | 分類코드 | 비고1a라구
------------------+----------+------------ ------------------+----------+------------
컴퓨터프로그래머 | 人Z01下 | 컴퓨터프로그래머 | 人Z01下 |
(1 row) (1 row)
select * from 計算機용어 where 용어 ~ '컴퓨터[디그]' select * from 計算機용어 where 용어 ~ '컴퓨터[디그]';
용어 | 分類코드 | 비고1a라구 용어 | 分類코드 | 비고1a라구
------------------+----------+------------ ------------------+----------+------------
컴퓨터디스플레이 | 機A01上 | 컴퓨터디스플레이 | 機A01上 |
컴퓨터그래픽스 | 分B10中 | 컴퓨터그래픽스 | 分B10中 |
(2 rows) (2 rows)
select * from 計算機용어 where 용어 ~* '컴퓨터[디그]' select * from 計算機용어 where 용어 ~* '컴퓨터[디그]';
용어 | 分類코드 | 비고1a라구 용어 | 分類코드 | 비고1a라구
------------------+----------+------------ ------------------+----------+------------
컴퓨터디스플레이 | 機A01上 | 컴퓨터디스플레이 | 機A01上 |
컴퓨터그래픽스 | 分B10中 | 컴퓨터그래픽스 | 分B10中 |
(2 rows) (2 rows)
select *,character_length(용어) from 計算機용어 select *,character_length(용어) from 計算機용어;
용어 | 分類코드 | 비고1a라구 | length 용어 | 分類코드 | 비고1a라구 | char_length
------------------+----------+------------+-------- ------------------+----------+------------+-------------
컴퓨터디스플레이 | 機A01上 | | 8 컴퓨터디스플레이 | 機A01上 | | 8
컴퓨터그래픽스 | 分B10中 | | 7 컴퓨터그래픽스 | 分B10中 | | 7
컴퓨터프로그래머 | 人Z01下 | | 8 컴퓨터프로그래머 | 人Z01下 | | 8
(3 rows) (3 rows)
select *,octet_length(용어) from 計算機용어 select *,octet_length(용어) from 計算機용어;
용어 | 分類코드 | 비고1a라구 | octet_length 용어 | 分類코드 | 비고1a라구 | octet_length
------------------+----------+------------+-------------- ------------------+----------+------------+--------------
컴퓨터디스플레이 | 機A01上 | | 16 컴퓨터디스플레이 | 機A01上 | | 16
...@@ -69,7 +69,7 @@ select *,octet_length( ...@@ -69,7 +69,7 @@ select *,octet_length(
컴퓨터프로그래머 | 人Z01下 | | 16 컴퓨터프로그래머 | 人Z01下 | | 16
(3 rows) (3 rows)
select *,position('디' in 용어) from 計算機용어 select *,position('디' in 용어) from 計算機용어;
용어 | 分類코드 | 비고1a라구 | strpos 용어 | 分類코드 | 비고1a라구 | strpos
------------------+----------+------------+-------- ------------------+----------+------------+--------
컴퓨터디스플레이 | 機A01上 | | 4 컴퓨터디스플레이 | 機A01上 | | 4
...@@ -77,7 +77,7 @@ select *,position(' ...@@ -77,7 +77,7 @@ select *,position('
컴퓨터프로그래머 | 人Z01下 | | 0 컴퓨터프로그래머 | 人Z01下 | | 0
(3 rows) (3 rows)
select *,substring(용어 from 3 for 4) from 計算機용어 select *,substring(용어 from 3 for 4) from 計算機용어;
용어 | 分類코드 | 비고1a라구 | substr 용어 | 分類코드 | 비고1a라구 | substr
------------------+----------+------------+---------- ------------------+----------+------------+----------
컴퓨터디스플레이 | 機A01上 | | 터디스플 컴퓨터디스플레이 | 機A01上 | | 터디스플
......
drop table 燹俑骜砧 drop table 燹俑骜砧;
ERROR: Relation '燹俑骜砧' does not exist ERROR: Relation '燹俑骜砧' does not exist
create table 燹俑骜砧 (如淦杀 text, 狞瞥婉螭 varchar, 氢蛇 varchar(16)) create table 燹俑骜砧 (如淦杀 text, 狞瞥婉螭 varchar, 氢蛇 varchar(16));
create index 燹俑骜砧index1 on 燹俑骜砧 using btree (如淦杀) create index 燹俑骜砧index1 on 燹俑骜砧 using btree (如淦杀);
create index 燹俑骜砧index2 on 燹俑骜砧 using hash (狞瞥婉螭) create index 燹俑骜砧index2 on 燹俑骜砧 using hash (狞瞥婉螭);
insert into 燹俑骜砧 values ('缳妾淦', '绠绠绎世', '啤A01念') insert into 燹俑骜砧 values ('缳妾淦', '绠绠绎世', '啤A01念');
insert into 燹俑骜砧 values ('犒葸淦', '芈溷却宇狞瞥', '你B10你') insert into 燹俑骜砧 values ('犒葸淦', '芈溷却宇狞瞥', '你B10你');
insert into 燹俑骜砧 values ('螫悖淦', '印汤洗枪却宇狞瞥', '仨Z01摩') insert into 燹俑骜砧 values ('螫悖淦', '印汤洗枪却宇狞瞥', '仨Z01摩');
vacuum 燹俑骜砧 vacuum 燹俑骜砧;
select * from 燹俑骜砧 select * from 燹俑骜砧;
如淦杀 | 狞瞥婉螭 | 氢蛇 如淦杀 | 狞瞥婉螭 | 氢蛇
--------+------------------+--------- --------+------------------+---------
缳妾淦 | 绠绠绎世 | 啤A01念 缳妾淦 | 绠绠绎世 | 啤A01念
...@@ -15,51 +15,51 @@ select * from ...@@ -15,51 +15,51 @@ select * from
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩
(3 rows) (3 rows)
select * from 燹俑骜砧 where 氢蛇 = '仨Z01摩' select * from 燹俑骜砧 where 氢蛇 = '仨Z01摩';
如淦杀 | 狞瞥婉螭 | 氢蛇 如淦杀 | 狞瞥婉螭 | 氢蛇
--------+------------------+--------- --------+------------------+---------
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩
(1 row) (1 row)
select * from 燹俑骜砧 where 氢蛇 ~* '仨z01摩' select * from 燹俑骜砧 where 氢蛇 ~* '仨z01摩';
如淦杀 | 狞瞥婉螭 | 氢蛇 如淦杀 | 狞瞥婉螭 | 氢蛇
--------+------------------+--------- --------+------------------+---------
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩
(1 row) (1 row)
select * from 燹俑骜砧 where 氢蛇 like '_Z01_' select * from 燹俑骜砧 where 氢蛇 like '_Z01_';
如淦杀 | 狞瞥婉螭 | 氢蛇 如淦杀 | 狞瞥婉螭 | 氢蛇
--------+------------------+--------- --------+------------------+---------
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩
(1 row) (1 row)
select * from 燹俑骜砧 where 氢蛇 like '_Z%' select * from 燹俑骜砧 where 氢蛇 like '_Z%';
如淦杀 | 狞瞥婉螭 | 氢蛇 如淦杀 | 狞瞥婉螭 | 氢蛇
--------+------------------+--------- --------+------------------+---------
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩
(1 row) (1 row)
select * from 燹俑骜砧 where 狞瞥婉螭 ~ '绠绠绎[凫卮世]' select * from 燹俑骜砧 where 狞瞥婉螭 ~ '绠绠绎[凫卮世]';
如淦杀 | 狞瞥婉螭 | 氢蛇 如淦杀 | 狞瞥婉螭 | 氢蛇
--------+----------+--------- --------+----------+---------
缳妾淦 | 绠绠绎世 | 啤A01念 缳妾淦 | 绠绠绎世 | 啤A01念
(1 row) (1 row)
select * from 燹俑骜砧 where 狞瞥婉螭 ~* '绠绠绎[凫卮世]' select * from 燹俑骜砧 where 狞瞥婉螭 ~* '绠绠绎[凫卮世]';
如淦杀 | 狞瞥婉螭 | 氢蛇 如淦杀 | 狞瞥婉螭 | 氢蛇
--------+----------+--------- --------+----------+---------
缳妾淦 | 绠绠绎世 | 啤A01念 缳妾淦 | 绠绠绎世 | 啤A01念
(1 row) (1 row)
select *, character_length(如淦杀) from 燹俑骜砧 select *, character_length(如淦杀) from 燹俑骜砧;
如淦杀 | 狞瞥婉螭 | 氢蛇 | length 如淦杀 | 狞瞥婉螭 | 氢蛇 | char_length
--------+------------------+---------+-------- --------+------------------+---------+-------------
缳妾淦 | 绠绠绎世 | 啤A01念 | 3 缳妾淦 | 绠绠绎世 | 啤A01念 | 3
犒葸淦 | 芈溷却宇狞瞥 | 你B10你 | 3 犒葸淦 | 芈溷却宇狞瞥 | 你B10你 | 3
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 | 3 螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 | 3
(3 rows) (3 rows)
select *, octet_length(如淦杀) from 燹俑骜砧 select *, octet_length(如淦杀) from 燹俑骜砧;
如淦杀 | 狞瞥婉螭 | 氢蛇 | octet_length 如淦杀 | 狞瞥婉螭 | 氢蛇 | octet_length
--------+------------------+---------+-------------- --------+------------------+---------+--------------
缳妾淦 | 绠绠绎世 | 啤A01念 | 6 缳妾淦 | 绠绠绎世 | 啤A01念 | 6
...@@ -67,7 +67,7 @@ select *, octet_length( ...@@ -67,7 +67,7 @@ select *, octet_length(
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 | 6 螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 | 6
(3 rows) (3 rows)
select *, position('却宇' in 狞瞥婉螭) from 燹俑骜砧 select *, position('却宇' in 狞瞥婉螭) from 燹俑骜砧;
如淦杀 | 狞瞥婉螭 | 氢蛇 | strpos 如淦杀 | 狞瞥婉螭 | 氢蛇 | strpos
--------+------------------+---------+-------- --------+------------------+---------+--------
缳妾淦 | 绠绠绎世 | 啤A01念 | 0 缳妾淦 | 绠绠绎世 | 啤A01念 | 0
...@@ -75,7 +75,7 @@ select *, position('却 ...@@ -75,7 +75,7 @@ select *, position('却
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 | 5 螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 | 5
(3 rows) (3 rows)
select *, substring(狞瞥婉螭 from 3 for 6 ) from 燹俑骜砧 select *, substring(狞瞥婉螭 from 3 for 6 ) from 燹俑骜砧;
如淦杀 | 狞瞥婉螭 | 氢蛇 | substr 如淦杀 | 狞瞥婉螭 | 氢蛇 | substr
--------+------------------+---------+-------------- --------+------------------+---------+--------------
缳妾淦 | 绠绠绎世 | 啤A01念 | 绎世 缳妾淦 | 绠绠绎世 | 啤A01念 | 绎世
......
drop table גђ drop table גђ;
ERROR: Relation 'גђ' does not exist ERROR: Relation 'גђ' does not exist
create table גђ (ђ text, ʬ varchar, 1A char(16)) create table גђ (ђ text, ʬ varchar, 1A char(16));
create index גђindex1 on גђ using btree (ђ) create index גђindex1 on גђ using btree (ђ);
create index גђindex2 on גђ using hash (ʬ) create index גђindex2 on גђ using hash (ʬ);
insert into גђ values('Ԓ咡ǒג쒥','A01') insert into גђ values('Ԓ咡ǒג쒥','A01');
insert into גђ values('Ԓ咡钥ՒÒ','ʬB10') insert into גђ values('Ԓ咡钥ՒÒ','ʬB10');
insert into גђ values('Ԓ咡ג풥钥ޒ','Z01') insert into גђ values('Ԓ咡ג풥钥ޒ','Z01');
vacuum גђ vacuum גђ;
select * from גђ select * from גђ;
ђ | ʬ | 1a ђ | ʬ | 1a
-----------------------------------------+-----------------+---------------- -----------------------------------------+-----------------+----------------
Ԓ咡ǒג쒥 | A01 | Ԓ咡ǒג쒥 | A01 |
...@@ -15,53 +15,53 @@ select * from ...@@ -15,53 +15,53 @@ select * from
Ԓ咡ג풥钥ޒ | Z01 | Ԓ咡ג풥钥ޒ | Z01 |
(3 rows) (3 rows)
select * from גђ where ʬ = 'Z01' select * from גђ where ʬ = 'Z01';
ђ | ʬ | 1a ђ | ʬ | 1a
--------------------------------------+-----------------+---------------- --------------------------------------+-----------------+----------------
Ԓ咡ג풥钥ޒ | Z01 | Ԓ咡ג풥钥ޒ | Z01 |
(1 row) (1 row)
select * from גђ where ʬ ~* 'z01' select * from גђ where ʬ ~* 'z01';
ђ | ʬ | 1a ђ | ʬ | 1a
--------------------------------------+-----------------+---------------- --------------------------------------+-----------------+----------------
Ԓ咡ג풥钥ޒ | Z01 | Ԓ咡ג풥钥ޒ | Z01 |
(1 row) (1 row)
select * from גђ where ʬ like '_Z01_' select * from גђ where ʬ like '_Z01_';
ђ | ʬ | 1a ђ | ʬ | 1a
--------------------------------------+-----------------+---------------- --------------------------------------+-----------------+----------------
Ԓ咡ג풥钥ޒ | Z01 | Ԓ咡ג풥钥ޒ | Z01 |
(1 row) (1 row)
select * from גђ where ʬ like '_Z%' select * from גђ where ʬ like '_Z%';
ђ | ʬ | 1a ђ | ʬ | 1a
--------------------------------------+-----------------+---------------- --------------------------------------+-----------------+----------------
Ԓ咡ג풥钥ޒ | Z01 | Ԓ咡ג풥钥ޒ | Z01 |
(1 row) (1 row)
select * from גђ where ђ ~ 'Ԓ咡[ǒ]' select * from גђ where ђ ~ 'Ԓ咡[ǒ]';
ђ | ʬ | 1a ђ | ʬ | 1a
-----------------------------------------+-----------------+---------------- -----------------------------------------+-----------------+----------------
Ԓ咡ǒג쒥 | A01 | Ԓ咡ǒג쒥 | A01 |
Ԓ咡钥ՒÒ | ʬB10 | Ԓ咡钥ՒÒ | ʬB10 |
(2 rows) (2 rows)
select * from גђ where ђ ~* 'Ԓ咡[ǒ]' select * from גђ where ђ ~* 'Ԓ咡[ǒ]';
ђ | ʬ | 1a ђ | ʬ | 1a
-----------------------------------------+-----------------+---------------- -----------------------------------------+-----------------+----------------
Ԓ咡ǒג쒥 | A01 | Ԓ咡ǒג쒥 | A01 |
Ԓ咡钥ՒÒ | ʬB10 | Ԓ咡钥ՒÒ | ʬB10 |
(2 rows) (2 rows)
select *,character_length(ђ) from גђ select *,character_length(ђ) from גђ;
ђ | ʬ | 1a | length ђ | ʬ | 1a | char_length
-----------------------------------------+-----------------+----------------+-------- -----------------------------------------+-----------------+----------------+-------------
Ԓ咡ǒג쒥 | A01 | | 12 Ԓ咡ǒג쒥 | A01 | | 12
Ԓ咡钥ՒÒ | ʬB10 | | 13 Ԓ咡钥ՒÒ | ʬB10 | | 13
Ԓ咡ג풥钥ޒ | Z01 | | 12 Ԓ咡ג풥钥ޒ | Z01 | | 12
(3 rows) (3 rows)
select *,octet_length(ђ) from גђ select *,octet_length(ђ) from גђ;
ђ | ʬ | 1a | octet_length ђ | ʬ | 1a | octet_length
-----------------------------------------+-----------------+----------------+-------------- -----------------------------------------+-----------------+----------------+--------------
Ԓ咡ǒג쒥 | A01 | | 36 Ԓ咡ǒג쒥 | A01 | | 36
...@@ -69,7 +69,7 @@ select *,octet_length( ...@@ -69,7 +69,7 @@ select *,octet_length(
Ԓ咡ג풥钥ޒ | Z01 | | 36 Ԓ咡ג풥钥ޒ | Z01 | | 36
(3 rows) (3 rows)
select *,position('' in ђ) from גђ select *,position('' in ђ) from גђ;
ђ | ʬ | 1a | strpos ђ | ʬ | 1a | strpos
-----------------------------------------+-----------------+----------------+-------- -----------------------------------------+-----------------+----------------+--------
Ԓ咡ǒג쒥 | A01 | | 7 Ԓ咡ǒג쒥 | A01 | | 7
...@@ -77,7 +77,7 @@ select *,position(' ...@@ -77,7 +77,7 @@ select *,position('
Ԓ咡ג풥钥ޒ | Z01 | | 0 Ԓ咡ג풥钥ޒ | Z01 | | 0
(3 rows) (3 rows)
select *,substring(ђ from 10 for 4) from גђ select *,substring(ђ from 10 for 4) from גђ;
ђ | ʬ | 1a | substr ђ | ʬ | 1a | substr
-----------------------------------------+-----------------+----------------+-------------- -----------------------------------------+-----------------+----------------+--------------
Ԓ咡ǒג쒥 | A01 | | ג쒥 Ԓ咡ǒג쒥 | A01 | | ג쒥
...@@ -85,16 +85,16 @@ select *,substring( ...@@ -85,16 +85,16 @@ select *,substring(
Ԓ咡ג풥钥ޒ | Z01 | | 钥ޒ Ԓ咡ג풥钥ޒ | Z01 | | 钥ޒ
(3 rows) (3 rows)
drop table Ƒ㑻 drop table Ƒ㑻;
ERROR: Relation 'Ƒ㑻' does not exist ERROR: Relation 'Ƒ㑻' does not exist
create table Ƒ㑻( text, ֑ varchar, ע1A char(16)) create table Ƒ㑻( text, ֑ varchar, ע1A char(16));
create index Ƒ㑻index1 on Ƒ㑻 using btree() create index Ƒ㑻index1 on Ƒ㑻 using btree();
create index Ƒ㑻index2 on Ƒ㑻 using btree(֑) create index Ƒ㑻index2 on Ƒ㑻 using btree(֑);
insert into Ƒ㑻 values('ԑԑʾ','A01') insert into Ƒ㑻 values('ԑԑʾ','A01');
insert into Ƒ㑻 values('ԑͼ','B01') insert into Ƒ㑻 values('ԑͼ','B01');
insert into Ƒ㑻 values('ԑ̑Ա','Z01') insert into Ƒ㑻 values('ԑ̑Ա','Z01');
vacuum Ƒ㑻 vacuum Ƒ㑻;
select * from Ƒ㑻 select * from Ƒ㑻;
| ֑ | ע1a | ֑ | ע1a
-----------------+-----------+---------- -----------------+-----------+----------
ԑԑʾ | A01 | ԑԑʾ | A01 |
...@@ -102,53 +102,53 @@ select * from ...@@ -102,53 +102,53 @@ select * from
ԑ̑Ա | Z01 | ԑ̑Ա | Z01 |
(3 rows) (3 rows)
select * from Ƒ㑻 where ֑ = 'Z01' select * from Ƒ㑻 where ֑ = 'Z01';
| ֑ | ע1a | ֑ | ע1a
-----------------+-----------+---------- -----------------+-----------+----------
ԑ̑Ա | Z01 | ԑ̑Ա | Z01 |
(1 row) (1 row)
select * from Ƒ㑻 where ֑ ~* 'z01' select * from Ƒ㑻 where ֑ ~* 'z01';
| ֑ | ע1a | ֑ | ע1a
-----------------+-----------+---------- -----------------+-----------+----------
ԑ̑Ա | Z01 | ԑ̑Ա | Z01 |
(1 row) (1 row)
select * from Ƒ㑻 where ֑ like '_Z01_' select * from Ƒ㑻 where ֑ like '_Z01_';
| ֑ | ע1a | ֑ | ע1a
-----------------+-----------+---------- -----------------+-----------+----------
ԑ̑Ա | Z01 | ԑ̑Ա | Z01 |
(1 row) (1 row)
select * from Ƒ㑻 where ֑ like '_Z%' select * from Ƒ㑻 where ֑ like '_Z%';
| ֑ | ע1a | ֑ | ע1a
-----------------+-----------+---------- -----------------+-----------+----------
ԑ̑Ա | Z01 | ԑ̑Ա | Z01 |
(1 row) (1 row)
select * from Ƒ㑻 where ~ '[ԑͼ]' select * from Ƒ㑻 where ~ '[ԑͼ]';
| ֑ | ע1a | ֑ | ע1a
-----------------+-----------+---------- -----------------+-----------+----------
ԑԑʾ | A01 | ԑԑʾ | A01 |
ԑͼ | B01 | ԑͼ | B01 |
(2 rows) (2 rows)
select * from Ƒ㑻 where ~* '[ԑͼ]' select * from Ƒ㑻 where ~* '[ԑͼ]';
| ֑ | ע1a | ֑ | ע1a
-----------------+-----------+---------- -----------------+-----------+----------
ԑԑʾ | A01 | ԑԑʾ | A01 |
ԑͼ | B01 | ԑͼ | B01 |
(2 rows) (2 rows)
select *,character_length() from Ƒ㑻 select *,character_length() from Ƒ㑻;
| ֑ | ע1a | length | ֑ | ע1a | char_length
-----------------+-----------+----------+-------- -----------------+-----------+----------+-------------
ԑԑʾ | A01 | | 5 ԑԑʾ | A01 | | 5
ԑͼ | B01 | | 4 ԑͼ | B01 | | 4
ԑ̑Ա | Z01 | | 5 ԑ̑Ա | Z01 | | 5
(3 rows) (3 rows)
select *,octet_length() from Ƒ㑻 select *,octet_length() from Ƒ㑻;
| ֑ | ע1a | octet_length | ֑ | ע1a | octet_length
-----------------+-----------+----------+-------------- -----------------+-----------+----------+--------------
ԑԑʾ | A01 | | 15 ԑԑʾ | A01 | | 15
...@@ -156,7 +156,7 @@ select *,octet_length( ...@@ -156,7 +156,7 @@ select *,octet_length(
ԑ̑Ա | Z01 | | 15 ԑ̑Ա | Z01 | | 15
(3 rows) (3 rows)
select *,position('' in ) from Ƒ㑻 select *,position('' in ) from Ƒ㑻;
| ֑ | ע1a | strpos | ֑ | ע1a | strpos
-----------------+-----------+----------+-------- -----------------+-----------+----------+--------
ԑԑʾ | A01 | | 3 ԑԑʾ | A01 | | 3
...@@ -164,7 +164,7 @@ select *,position(' ...@@ -164,7 +164,7 @@ select *,position('
ԑ̑Ա | Z01 | | 0 ԑ̑Ա | Z01 | | 0
(3 rows) (3 rows)
select *,substring( from 3 for 4) from Ƒ㑻 select *,substring( from 3 for 4) from Ƒ㑻;
| ֑ | ע1a | substr | ֑ | ע1a | substr
-----------------+-----------+----------+----------- -----------------+-----------+----------+-----------
ԑԑʾ | A01 | | ԑʾ ԑԑʾ | A01 | | ԑʾ
...@@ -172,16 +172,16 @@ select *,substring( ...@@ -172,16 +172,16 @@ select *,substring(
ԑ̑Ա | Z01 | | ̑Ա ԑ̑Ա | Z01 | | ̑Ա
(3 rows) (3 rows)
drop table ͪߩѦ듾 drop table ͪߩѦ듾;
ERROR: Relation 'ͪߩѦ듾' does not exist ERROR: Relation 'ͪߩѦ듾' does not exist
create table ͪߩѦ듾 (듾 text, “׾ړ varchar, 1A󓱸 char(16)) create table ͪߩѦ듾 (듾 text, “׾ړ varchar, 1A󓱸 char(16));
create index ͪߩѦ듾index1 on ͪߩѦ듾 using btree (듾) create index ͪߩѦ듾index1 on ͪߩѦ듾 using btree (듾);
create index ͪߩѦ듾index2 on ͪߩѦ듾 using hash (“׾ړ) create index ͪߩѦ듾index2 on ͪߩѦ듾 using hash (“׾ړ);
insert into ͪߩѦ듾 values('ēǻ͓𓽺Ó', 'ѦA01߾') insert into ͪߩѦ듾 values('ēǻ͓𓽺Ó', 'ѦA01߾');
insert into ͪߩѦ듾 values('ēǻ͓דȓ', 'B10') insert into ͪߩѦ듾 values('ēǻ͓דȓ', 'B10');
insert into ͪߩѦ듾 values('ēǻ͓Γד', 'Z01') insert into ͪߩѦ듾 values('ēǻ͓Γד', 'Z01');
vacuum ͪߩѦ듾 vacuum ͪߩѦ듾;
select * from ͪߩѦ듾 select * from ͪߩѦ듾;
듾 | “׾ړ | 1a󓱸 듾 | “׾ړ | 1a󓱸
--------------------------+--------------+---------------- --------------------------+--------------+----------------
ēǻ͓𓽺Ó | ѦA01߾ | ēǻ͓𓽺Ó | ѦA01߾ |
...@@ -189,53 +189,53 @@ select * from ...@@ -189,53 +189,53 @@ select * from
ēǻ͓Γד | Z01 | ēǻ͓Γד | Z01 |
(3 rows) (3 rows)
select * from ͪߩѦ듾 where “׾ړ = 'Z01' select * from ͪߩѦ듾 where “׾ړ = 'Z01';
듾 | “׾ړ | 1a󓱸 듾 | “׾ړ | 1a󓱸
--------------------------+--------------+---------------- --------------------------+--------------+----------------
ēǻ͓Γד | Z01 | ēǻ͓Γד | Z01 |
(1 row) (1 row)
select * from ͪߩѦ듾 where “׾ړ ~* 'z01' select * from ͪߩѦ듾 where “׾ړ ~* 'z01';
듾 | “׾ړ | 1a󓱸 듾 | “׾ړ | 1a󓱸
--------------------------+--------------+---------------- --------------------------+--------------+----------------
ēǻ͓Γד | Z01 | ēǻ͓Γד | Z01 |
(1 row) (1 row)
select * from ͪߩѦ듾 where “׾ړ like '_Z01_' select * from ͪߩѦ듾 where “׾ړ like '_Z01_';
듾 | “׾ړ | 1a󓱸 듾 | “׾ړ | 1a󓱸
--------------------------+--------------+---------------- --------------------------+--------------+----------------
ēǻ͓Γד | Z01 | ēǻ͓Γד | Z01 |
(1 row) (1 row)
select * from ͪߩѦ듾 where “׾ړ like '_Z%' select * from ͪߩѦ듾 where “׾ړ like '_Z%';
듾 | “׾ړ | 1a󓱸 듾 | “׾ړ | 1a󓱸
--------------------------+--------------+---------------- --------------------------+--------------+----------------
ēǻ͓Γד | Z01 | ēǻ͓Γד | Z01 |
(1 row) (1 row)
select * from ͪߩѦ듾 where 듾 ~ 'ēǻ[]' select * from ͪߩѦ듾 where 듾 ~ 'ēǻ[]';
듾 | “׾ړ | 1a󓱸 듾 | “׾ړ | 1a󓱸
--------------------------+--------------+---------------- --------------------------+--------------+----------------
ēǻ͓𓽺Ó | ѦA01߾ | ēǻ͓𓽺Ó | ѦA01߾ |
ēǻ͓דȓ | B10 | ēǻ͓דȓ | B10 |
(2 rows) (2 rows)
select * from ͪߩѦ듾 where 듾 ~* 'ēǻ[]' select * from ͪߩѦ듾 where 듾 ~* 'ēǻ[]';
듾 | “׾ړ | 1a󓱸 듾 | “׾ړ | 1a󓱸
--------------------------+--------------+---------------- --------------------------+--------------+----------------
ēǻ͓𓽺Ó | ѦA01߾ | ēǻ͓𓽺Ó | ѦA01߾ |
ēǻ͓דȓ | B10 | ēǻ͓דȓ | B10 |
(2 rows) (2 rows)
select *,character_length(듾) from ͪߩѦ듾 select *,character_length(듾) from ͪߩѦ듾;
듾 | “׾ړ | 1a󓱸 | length 듾 | “׾ړ | 1a󓱸 | char_length
--------------------------+--------------+----------------+-------- --------------------------+--------------+----------------+-------------
ēǻ͓𓽺Ó | ѦA01߾ | | 8 ēǻ͓𓽺Ó | ѦA01߾ | | 8
ēǻ͓דȓ | B10 | | 7 ēǻ͓דȓ | B10 | | 7
ēǻ͓Γד | Z01 | | 8 ēǻ͓Γד | Z01 | | 8
(3 rows) (3 rows)
select *,octet_length(듾) from ͪߩѦ듾 select *,octet_length(듾) from ͪߩѦ듾;
듾 | “׾ړ | 1a󓱸 | octet_length 듾 | “׾ړ | 1a󓱸 | octet_length
--------------------------+--------------+----------------+-------------- --------------------------+--------------+----------------+--------------
ēǻ͓𓽺Ó | ѦA01߾ | | 24 ēǻ͓𓽺Ó | ѦA01߾ | | 24
...@@ -243,7 +243,7 @@ select *,octet_length( ...@@ -243,7 +243,7 @@ select *,octet_length(
ēǻ͓Γד | Z01 | | 24 ēǻ͓Γד | Z01 | | 24
(3 rows) (3 rows)
select *,position('' in 듾) from ͪߩѦ듾 select *,position('' in 듾) from ͪߩѦ듾;
듾 | “׾ړ | 1a󓱸 | strpos 듾 | “׾ړ | 1a󓱸 | strpos
--------------------------+--------------+----------------+-------- --------------------------+--------------+----------------+--------
ēǻ͓𓽺Ó | ѦA01߾ | | 4 ēǻ͓𓽺Ó | ѦA01߾ | | 4
...@@ -251,7 +251,7 @@ select *,position(' ...@@ -251,7 +251,7 @@ select *,position('
ēǻ͓Γד | Z01 | | 0 ēǻ͓Γד | Z01 | | 0
(3 rows) (3 rows)
select *,substring(듾 from 3 for 4) from ͪߩѦ듾 select *,substring(듾 from 3 for 4) from ͪߩѦ듾;
듾 | “׾ړ | 1a󓱸 | substr 듾 | “׾ړ | 1a󓱸 | substr
--------------------------+--------------+----------------+-------------- --------------------------+--------------+----------------+--------------
ēǻ͓𓽺Ó | ѦA01߾ | | ͓𓽺 ēǻ͓𓽺Ó | ѦA01߾ | | ͓𓽺
...@@ -259,16 +259,16 @@ select *,substring( ...@@ -259,16 +259,16 @@ select *,substring(
ēǻ͓Γד | Z01 | | ͓Γ ēǻ͓Γד | Z01 | | ͓Γ
(3 rows) (3 rows)
drop table test drop table test;
ERROR: Relation 'test' does not exist ERROR: Relation 'test' does not exist
create table test (t text) create table test (t text);
insert into test values('ENGLISH') insert into test values('ENGLISH');
insert into test values('FRANAIS') insert into test values('FRANAIS');
insert into test values('ESPAOL') insert into test values('ESPAOL');
insert into test values('SLENSKA') insert into test values('SLENSKA');
insert into test values('ENGLISH FRANAIS ESPAOL SLENSKA') insert into test values('ENGLISH FRANAIS ESPAOL SLENSKA');
vacuum test vacuum test;
select * from test select * from test;
t t
-------------------------------------- --------------------------------------
ENGLISH ENGLISH
...@@ -278,30 +278,30 @@ select * from test ...@@ -278,30 +278,30 @@ select * from test
ENGLISH FRANAIS ESPAOL SLENSKA ENGLISH FRANAIS ESPAOL SLENSKA
(5 rows) (5 rows)
select * from test where t = 'ESPAOL' select * from test where t = 'ESPAOL';
t t
---------- ----------
ESPAOL ESPAOL
(1 row) (1 row)
select * from test where t ~* 'espaol' select * from test where t ~* 'espaol';
t t
-------------------------------------- --------------------------------------
ESPAOL ESPAOL
ENGLISH FRANAIS ESPAOL SLENSKA ENGLISH FRANAIS ESPAOL SLENSKA
(2 rows) (2 rows)
select *,character_length(t) from test select *,character_length(t) from test;
t | length t | char_length
--------------------------------------+-------- --------------------------------------+-------------
ENGLISH | 7 ENGLISH | 7
FRANAIS | 8 FRANAIS | 8
ESPAOL | 7 ESPAOL | 7
SLENSKA | 8 SLENSKA | 8
ENGLISH FRANAIS ESPAOL SLENSKA | 33 ENGLISH FRANAIS ESPAOL SLENSKA | 33
(5 rows) (5 rows)
select *,octet_length(t) from test select *,octet_length(t) from test;
t | octet_length t | octet_length
--------------------------------------+-------------- --------------------------------------+--------------
ENGLISH | 7 ENGLISH | 7
...@@ -311,7 +311,7 @@ select *,octet_length(t) from test ...@@ -311,7 +311,7 @@ select *,octet_length(t) from test
ENGLISH FRANAIS ESPAOL SLENSKA | 36 ENGLISH FRANAIS ESPAOL SLENSKA | 36
(5 rows) (5 rows)
select *,position('L' in t) from test select *,position('L' in t) from test;
t | strpos t | strpos
--------------------------------------+-------- --------------------------------------+--------
ENGLISH | 4 ENGLISH | 4
...@@ -321,7 +321,7 @@ select *,position('L' in t) from test ...@@ -321,7 +321,7 @@ select *,position('L' in t) from test
ENGLISH FRANAIS ESPAOL SLENSKA | 4 ENGLISH FRANAIS ESPAOL SLENSKA | 4
(5 rows) (5 rows)
select *,substring(t from 3 for 4) from test select *,substring(t from 3 for 4) from test;
t | substr t | substr
--------------------------------------+-------- --------------------------------------+--------
ENGLISH | GLIS ENGLISH | GLIS
......
drop table 計算機用語 drop table 計算機用語;
create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16)) create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16));
create index 計算機用語index1 on 計算機用語 using btree (用語) create index 計算機用語index1 on 計算機用語 using btree (用語);
create index 計算機用語index2 on 計算機用語 using hash (分類コード) create index 計算機用語index2 on 計算機用語 using hash (分類コード);
insert into 計算機用語 values('コンピュータディスプレイ','機A01上') insert into 計算機用語 values('コンピュータディスプレイ','機A01上');
insert into 計算機用語 values('コンピュータグラフィックス','分B10中') insert into 計算機用語 values('コンピュータグラフィックス','分B10中');
insert into 計算機用語 values('コンピュータプログラマー','人Z01下') insert into 計算機用語 values('コンピュータプログラマー','人Z01下');
vacuum 計算機用語 vacuum 計算機用語;
select * from 計算機用語 select * from 計算機用語;
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
----------------------------+------------+------------ ----------------------------+------------+------------
コンピュータディスプレイ | 機A01上 | コンピュータディスプレイ | 機A01上 |
...@@ -14,53 +14,53 @@ select * from ...@@ -14,53 +14,53 @@ select * from
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(3 rows) (3 rows)
select * from 計算機用語 where 分類コード = '人Z01下' select * from 計算機用語 where 分類コード = '人Z01下';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
--------------------------+------------+------------ --------------------------+------------+------------
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(1 row) (1 row)
select * from 計算機用語 where 分類コード ~* '人z01下' select * from 計算機用語 where 分類コード ~* '人z01下';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
--------------------------+------------+------------ --------------------------+------------+------------
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(1 row) (1 row)
select * from 計算機用語 where 分類コード like '_Z01_' select * from 計算機用語 where 分類コード like '_Z01_';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
--------------------------+------------+------------ --------------------------+------------+------------
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(1 row) (1 row)
select * from 計算機用語 where 分類コード like '_Z%' select * from 計算機用語 where 分類コード like '_Z%';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
--------------------------+------------+------------ --------------------------+------------+------------
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(1 row) (1 row)
select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]' select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
----------------------------+------------+------------ ----------------------------+------------+------------
コンピュータディスプレイ | 機A01上 | コンピュータディスプレイ | 機A01上 |
コンピュータグラフィックス | 分B10中 | コンピュータグラフィックス | 分B10中 |
(2 rows) (2 rows)
select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]' select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
----------------------------+------------+------------ ----------------------------+------------+------------
コンピュータディスプレイ | 機A01上 | コンピュータディスプレイ | 機A01上 |
コンピュータグラフィックス | 分B10中 | コンピュータグラフィックス | 分B10中 |
(2 rows) (2 rows)
select *,character_length(用語) from 計算機用語 select *,character_length(用語) from 計算機用語;
用語 | 分類コード | 備考1aだよ | length 用語 | 分類コード | 備考1aだよ | char_length
----------------------------+------------+------------+-------- ----------------------------+------------+------------+-------------
コンピュータディスプレイ | 機A01上 | | 12 コンピュータディスプレイ | 機A01上 | | 12
コンピュータグラフィックス | 分B10中 | | 13 コンピュータグラフィックス | 分B10中 | | 13
コンピュータプログラマー | 人Z01下 | | 12 コンピュータプログラマー | 人Z01下 | | 12
(3 rows) (3 rows)
select *,octet_length(用語) from 計算機用語 select *,octet_length(用語) from 計算機用語;
用語 | 分類コード | 備考1aだよ | octet_length 用語 | 分類コード | 備考1aだよ | octet_length
----------------------------+------------+------------+-------------- ----------------------------+------------+------------+--------------
コンピュータディスプレイ | 機A01上 | | 24 コンピュータディスプレイ | 機A01上 | | 24
...@@ -68,7 +68,7 @@ select *,octet_length( ...@@ -68,7 +68,7 @@ select *,octet_length(
コンピュータプログラマー | 人Z01下 | | 24 コンピュータプログラマー | 人Z01下 | | 24
(3 rows) (3 rows)
select *,position('デ' in 用語) from 計算機用語 select *,position('デ' in 用語) from 計算機用語;
用語 | 分類コード | 備考1aだよ | strpos 用語 | 分類コード | 備考1aだよ | strpos
----------------------------+------------+------------+-------- ----------------------------+------------+------------+--------
コンピュータディスプレイ | 機A01上 | | 7 コンピュータディスプレイ | 機A01上 | | 7
...@@ -76,7 +76,7 @@ select *,position(' ...@@ -76,7 +76,7 @@ select *,position('
コンピュータプログラマー | 人Z01下 | | 0 コンピュータプログラマー | 人Z01下 | | 0
(3 rows) (3 rows)
select *,substring(用語 from 10 for 4) from 計算機用語 select *,substring(用語 from 10 for 4) from 計算機用語;
用語 | 分類コード | 備考1aだよ | substr 用語 | 分類コード | 備考1aだよ | substr
----------------------------+------------+------------+---------- ----------------------------+------------+------------+----------
コンピュータディスプレイ | 機A01上 | | プレイ コンピュータディスプレイ | 機A01上 | | プレイ
...@@ -84,7 +84,7 @@ select *,substring( ...@@ -84,7 +84,7 @@ select *,substring(
コンピュータプログラマー | 人Z01下 | | ラマー コンピュータプログラマー | 人Z01下 | | ラマー
(3 rows) (3 rows)
copy 計算機用語 to stdout copy 計算機用語 to stdout;
コンピュータディスプレイ 機A01上 \N コンピュータディスプレイ 機A01上 \N
コンピュータグラフィックス 分B10中 \N コンピュータグラフィックス 分B10中 \N
コンピュータプログラマー 人Z01下 \N コンピュータプログラマー 人Z01下 \N
drop table 計算機用語 drop table 計算機用語;
ERROR: Relation '計算機用語' does not exist ERROR: Relation '計算機用語' does not exist
create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16)) create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16));
create index 計算機用語index1 on 計算機用語 using btree (用語) create index 計算機用語index1 on 計算機用語 using btree (用語);
create index 計算機用語index2 on 計算機用語 using hash (分類コード) create index 計算機用語index2 on 計算機用語 using hash (分類コード);
insert into 計算機用語 values('コンピュータディスプレイ','機A01上') insert into 計算機用語 values('コンピュータディスプレイ','機A01上');
insert into 計算機用語 values('コンピュータグラフィックス','分B10中') insert into 計算機用語 values('コンピュータグラフィックス','分B10中');
insert into 計算機用語 values('コンピュータプログラマー','人Z01下') insert into 計算機用語 values('コンピュータプログラマー','人Z01下');
vacuum 計算機用語 vacuum 計算機用語;
select * from 計算機用語 select * from 計算機用語;
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
-----------------------------------------+-----------------+---------------- -----------------------------------------+-----------------+----------------
コンピュータディスプレイ | 機A01上 | コンピュータディスプレイ | 機A01上 |
...@@ -15,53 +15,53 @@ select * from 計算機用語 ...@@ -15,53 +15,53 @@ select * from 計算機用語
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(3 rows) (3 rows)
select * from 計算機用語 where 分類コード = '人Z01下' select * from 計算機用語 where 分類コード = '人Z01下';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
--------------------------------------+-----------------+---------------- --------------------------------------+-----------------+----------------
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(1 row) (1 row)
select * from 計算機用語 where 分類コード ~* '人z01下' select * from 計算機用語 where 分類コード ~* '人z01下';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
--------------------------------------+-----------------+---------------- --------------------------------------+-----------------+----------------
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(1 row) (1 row)
select * from 計算機用語 where 分類コード like '_Z01_' select * from 計算機用語 where 分類コード like '_Z01_';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
--------------------------------------+-----------------+---------------- --------------------------------------+-----------------+----------------
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(1 row) (1 row)
select * from 計算機用語 where 分類コード like '_Z%' select * from 計算機用語 where 分類コード like '_Z%';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
--------------------------------------+-----------------+---------------- --------------------------------------+-----------------+----------------
コンピュータプログラマー | 人Z01下 | コンピュータプログラマー | 人Z01下 |
(1 row) (1 row)
select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]' select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
-----------------------------------------+-----------------+---------------- -----------------------------------------+-----------------+----------------
コンピュータディスプレイ | 機A01上 | コンピュータディスプレイ | 機A01上 |
コンピュータグラフィックス | 分B10中 | コンピュータグラフィックス | 分B10中 |
(2 rows) (2 rows)
select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]' select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]';
用語 | 分類コード | 備考1aだよ 用語 | 分類コード | 備考1aだよ
-----------------------------------------+-----------------+---------------- -----------------------------------------+-----------------+----------------
コンピュータディスプレイ | 機A01上 | コンピュータディスプレイ | 機A01上 |
コンピュータグラフィックス | 分B10中 | コンピュータグラフィックス | 分B10中 |
(2 rows) (2 rows)
select *,character_length(用語) from 計算機用語 select *,character_length(用語) from 計算機用語;
用語 | 分類コード | 備考1aだよ | length 用語 | 分類コード | 備考1aだよ | char_length
-----------------------------------------+-----------------+----------------+-------- -----------------------------------------+-----------------+----------------+-------------
コンピュータディスプレイ | 機A01上 | | 12 コンピュータディスプレイ | 機A01上 | | 12
コンピュータグラフィックス | 分B10中 | | 13 コンピュータグラフィックス | 分B10中 | | 13
コンピュータプログラマー | 人Z01下 | | 12 コンピュータプログラマー | 人Z01下 | | 12
(3 rows) (3 rows)
select *,octet_length(用語) from 計算機用語 select *,octet_length(用語) from 計算機用語;
用語 | 分類コード | 備考1aだよ | octet_length 用語 | 分類コード | 備考1aだよ | octet_length
-----------------------------------------+-----------------+----------------+-------------- -----------------------------------------+-----------------+----------------+--------------
コンピュータディスプレイ | 機A01上 | | 36 コンピュータディスプレイ | 機A01上 | | 36
...@@ -69,7 +69,7 @@ select *,octet_length(用語) from 計算機用語 ...@@ -69,7 +69,7 @@ select *,octet_length(用語) from 計算機用語
コンピュータプログラマー | 人Z01下 | | 36 コンピュータプログラマー | 人Z01下 | | 36
(3 rows) (3 rows)
select *,position('デ' in 用語) from 計算機用語 select *,position('デ' in 用語) from 計算機用語;
用語 | 分類コード | 備考1aだよ | strpos 用語 | 分類コード | 備考1aだよ | strpos
-----------------------------------------+-----------------+----------------+-------- -----------------------------------------+-----------------+----------------+--------
コンピュータディスプレイ | 機A01上 | | 7 コンピュータディスプレイ | 機A01上 | | 7
...@@ -77,7 +77,7 @@ select *,position('デ' in 用語) from 計算機用語 ...@@ -77,7 +77,7 @@ select *,position('デ' in 用語) from 計算機用語
コンピュータプログラマー | 人Z01下 | | 0 コンピュータプログラマー | 人Z01下 | | 0
(3 rows) (3 rows)
select *,substring(用語 from 10 for 4) from 計算機用語 select *,substring(用語 from 10 for 4) from 計算機用語;
用語 | 分類コード | 備考1aだよ | substr 用語 | 分類コード | 備考1aだよ | substr
-----------------------------------------+-----------------+----------------+-------------- -----------------------------------------+-----------------+----------------+--------------
コンピュータディスプレイ | 機A01上 | | プレイ コンピュータディスプレイ | 機A01上 | | プレイ
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment