Fixes for char_length() changes.
This commit is contained in:
parent
d14c8aab99
commit
805e0c4589
|
@ -1,12 +1,12 @@
|
|||
drop table 廠商資料
|
||||
create table 廠商資料 (行業別 text, 公司抬頭 varchar, 地址 varchar(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 廠商資料
|
||||
drop table 廠商資料;
|
||||
create table 廠商資料 (行業別 text, 公司抬頭 varchar, 地址 varchar(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 廠商資料;
|
||||
行業別 | 公司抬頭 | 地址
|
||||
--------+------------------+---------
|
||||
電腦業 | 達達科技 | 北A01仁
|
||||
|
@ -14,51 +14,51 @@ select * from
|
|||
餐飲業 | 美味股份有限公司 | 高Z01九
|
||||
(3 rows)
|
||||
|
||||
select * from 廠商資料 where 地址 = '高Z01九'
|
||||
select * from 廠商資料 where 地址 = '高Z01九';
|
||||
行業別 | 公司抬頭 | 地址
|
||||
--------+------------------+---------
|
||||
餐飲業 | 美味股份有限公司 | 高Z01九
|
||||
(1 row)
|
||||
|
||||
select * from 廠商資料 where 地址 ~* '高z01九'
|
||||
select * from 廠商資料 where 地址 ~* '高z01九';
|
||||
行業別 | 公司抬頭 | 地址
|
||||
--------+------------------+---------
|
||||
餐飲業 | 美味股份有限公司 | 高Z01九
|
||||
(1 row)
|
||||
|
||||
select * from 廠商資料 where 地址 like '_Z01_'
|
||||
select * from 廠商資料 where 地址 like '_Z01_';
|
||||
行業別 | 公司抬頭 | 地址
|
||||
--------+------------------+---------
|
||||
餐飲業 | 美味股份有限公司 | 高Z01九
|
||||
(1 row)
|
||||
|
||||
select * from 廠商資料 where 地址 like '_Z%'
|
||||
select * from 廠商資料 where 地址 like '_Z%';
|
||||
行業別 | 公司抬頭 | 地址
|
||||
--------+------------------+---------
|
||||
餐飲業 | 美味股份有限公司 | 高Z01九
|
||||
(1 row)
|
||||
|
||||
select * from 廠商資料 where 公司抬頭 ~ '達達科[寄記技]'
|
||||
select * from 廠商資料 where 公司抬頭 ~ '達達科[寄記技]';
|
||||
行業別 | 公司抬頭 | 地址
|
||||
--------+----------+---------
|
||||
電腦業 | 達達科技 | 北A01仁
|
||||
(1 row)
|
||||
|
||||
select * from 廠商資料 where 公司抬頭 ~* '達達科[寄記技]'
|
||||
select * from 廠商資料 where 公司抬頭 ~* '達達科[寄記技]';
|
||||
行業別 | 公司抬頭 | 地址
|
||||
--------+----------+---------
|
||||
電腦業 | 達達科技 | 北A01仁
|
||||
(1 row)
|
||||
|
||||
select *, character_length(行業別) from 廠商資料
|
||||
行業別 | 公司抬頭 | 地址 | length
|
||||
--------+------------------+---------+--------
|
||||
電腦業 | 達達科技 | 北A01仁 | 3
|
||||
製造業 | 財源有限公司 | 中B10中 | 3
|
||||
餐飲業 | 美味股份有限公司 | 高Z01九 | 3
|
||||
select *, character_length(行業別) from 廠商資料;
|
||||
行業別 | 公司抬頭 | 地址 | char_length
|
||||
--------+------------------+---------+-------------
|
||||
電腦業 | 達達科技 | 北A01仁 | 3
|
||||
製造業 | 財源有限公司 | 中B10中 | 3
|
||||
餐飲業 | 美味股份有限公司 | 高Z01九 | 3
|
||||
(3 rows)
|
||||
|
||||
select *, octet_length(行業別) from 廠商資料
|
||||
select *, octet_length(行業別) from 廠商資料;
|
||||
行業別 | 公司抬頭 | 地址 | octet_length
|
||||
--------+------------------+---------+--------------
|
||||
電腦業 | 達達科技 | 北A01仁 | 6
|
||||
|
@ -66,7 +66,7 @@ select *, octet_length(
|
|||
餐飲業 | 美味股份有限公司 | 高Z01九 | 6
|
||||
(3 rows)
|
||||
|
||||
select *, position('有限' in 公司抬頭) from 廠商資料
|
||||
select *, position('有限' in 公司抬頭) from 廠商資料;
|
||||
行業別 | 公司抬頭 | 地址 | strpos
|
||||
--------+------------------+---------+--------
|
||||
電腦業 | 達達科技 | 北A01仁 | 0
|
||||
|
@ -74,7 +74,7 @@ select *, position('
|
|||
餐飲業 | 美味股份有限公司 | 高Z01九 | 5
|
||||
(3 rows)
|
||||
|
||||
select *, substring(公司抬頭 from 3 for 6 ) from 廠商資料
|
||||
select *, substring(公司抬頭 from 3 for 6 ) from 廠商資料;
|
||||
行業別 | 公司抬頭 | 地址 | substr
|
||||
--------+------------------+---------+--------------
|
||||
電腦業 | 達達科技 | 北A01仁 | 科技
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
drop table 计算机术语
|
||||
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 btree(分类号)
|
||||
insert into 计算机术语 values('电脑显示屏','机A01上')
|
||||
insert into 计算机术语 values('电脑图形','分B01中')
|
||||
insert into 计算机术语 values('电脑程序员','人Z01下')
|
||||
vacuum 计算机术语
|
||||
select * from 计算机术语
|
||||
create table 计算机术语(术语 text, 分类号 varchar, 备注1A char(16));
|
||||
create index 计算机术语index1 on 计算机术语 using btree(术语);
|
||||
create index 计算机术语index2 on 计算机术语 using btree(分类号);
|
||||
insert into 计算机术语 values('电脑显示屏','机A01上');
|
||||
insert into 计算机术语 values('电脑图形','分B01中');
|
||||
insert into 计算机术语 values('电脑程序员','人Z01下');
|
||||
vacuum 计算机术语;
|
||||
select * from 计算机术语;
|
||||
术语 | 分类号 | 备注1a
|
||||
------------+---------+--------
|
||||
电脑显示屏 | 机A01上 |
|
||||
|
@ -15,53 +15,53 @@ select * from
|
|||
电脑程序员 | 人Z01下 |
|
||||
(3 rows)
|
||||
|
||||
select * from 计算机术语 where 分类号 = '人Z01下'
|
||||
select * from 计算机术语 where 分类号 = '人Z01下';
|
||||
术语 | 分类号 | 备注1a
|
||||
------------+---------+--------
|
||||
电脑程序员 | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 计算机术语 where 分类号 ~* '人z01下'
|
||||
select * from 计算机术语 where 分类号 ~* '人z01下';
|
||||
术语 | 分类号 | 备注1a
|
||||
------------+---------+--------
|
||||
电脑程序员 | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 计算机术语 where 分类号 like '_Z01_'
|
||||
select * from 计算机术语 where 分类号 like '_Z01_';
|
||||
术语 | 分类号 | 备注1a
|
||||
------------+---------+--------
|
||||
电脑程序员 | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 计算机术语 where 分类号 like '_Z%'
|
||||
select * from 计算机术语 where 分类号 like '_Z%';
|
||||
术语 | 分类号 | 备注1a
|
||||
------------+---------+--------
|
||||
电脑程序员 | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 计算机术语 where 术语 ~ '电脑[显图]'
|
||||
select * from 计算机术语 where 术语 ~ '电脑[显图]';
|
||||
术语 | 分类号 | 备注1a
|
||||
------------+---------+--------
|
||||
电脑显示屏 | 机A01上 |
|
||||
电脑图形 | 分B01中 |
|
||||
(2 rows)
|
||||
|
||||
select * from 计算机术语 where 术语 ~* '电脑[显图]'
|
||||
select * from 计算机术语 where 术语 ~* '电脑[显图]';
|
||||
术语 | 分类号 | 备注1a
|
||||
------------+---------+--------
|
||||
电脑显示屏 | 机A01上 |
|
||||
电脑图形 | 分B01中 |
|
||||
(2 rows)
|
||||
|
||||
select *,character_length(术语) from 计算机术语
|
||||
术语 | 分类号 | 备注1a | length
|
||||
------------+---------+--------+--------
|
||||
电脑显示屏 | 机A01上 | | 5
|
||||
电脑图形 | 分B01中 | | 4
|
||||
电脑程序员 | 人Z01下 | | 5
|
||||
select *,character_length(术语) from 计算机术语;
|
||||
术语 | 分类号 | 备注1a | char_length
|
||||
------------+---------+--------+-------------
|
||||
电脑显示屏 | 机A01上 | | 5
|
||||
电脑图形 | 分B01中 | | 4
|
||||
电脑程序员 | 人Z01下 | | 5
|
||||
(3 rows)
|
||||
|
||||
select *,octet_length(术语) from 计算机术语
|
||||
select *,octet_length(术语) from 计算机术语;
|
||||
术语 | 分类号 | 备注1a | octet_length
|
||||
------------+---------+--------+--------------
|
||||
电脑显示屏 | 机A01上 | | 10
|
||||
|
@ -69,7 +69,7 @@ select *,octet_length(
|
|||
电脑程序员 | 人Z01下 | | 10
|
||||
(3 rows)
|
||||
|
||||
select *,position('显' in 术语) from 计算机术语
|
||||
select *,position('显' in 术语) from 计算机术语;
|
||||
术语 | 分类号 | 备注1a | strpos
|
||||
------------+---------+--------+--------
|
||||
电脑显示屏 | 机A01上 | | 3
|
||||
|
@ -77,7 +77,7 @@ select *,position('
|
|||
电脑程序员 | 人Z01下 | | 0
|
||||
(3 rows)
|
||||
|
||||
select *,substring(术语 from 3 for 4) from 计算机术语
|
||||
select *,substring(术语 from 3 for 4) from 计算机术语;
|
||||
术语 | 分类号 | 备注1a | substr
|
||||
------------+---------+--------+--------
|
||||
电脑显示屏 | 机A01上 | | 显示屏
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
drop table 計算機用語
|
||||
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 計算機用語
|
||||
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上 |
|
||||
|
@ -15,53 +15,53 @@ select * from
|
|||
コンピュータプログラマー | 人Z01下 |
|
||||
(3 rows)
|
||||
|
||||
select * from 計算機用語 where 分類コード = '人Z01下'
|
||||
select * from 計算機用語 where 分類コード = '人Z01下';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------+------------+------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 分類コード ~* '人z01下'
|
||||
select * from 計算機用語 where 分類コード ~* '人z01下';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------+------------+------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 分類コード like '_Z01_'
|
||||
select * from 計算機用語 where 分類コード like '_Z01_';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------+------------+------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 分類コード like '_Z%'
|
||||
select * from 計算機用語 where 分類コード like '_Z%';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------+------------+------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]'
|
||||
select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
----------------------------+------------+------------
|
||||
コンピュータディスプレイ | 機A01上 |
|
||||
コンピュータグラフィックス | 分B10中 |
|
||||
(2 rows)
|
||||
|
||||
select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]'
|
||||
select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
----------------------------+------------+------------
|
||||
コンピュータディスプレイ | 機A01上 |
|
||||
コンピュータグラフィックス | 分B10中 |
|
||||
(2 rows)
|
||||
|
||||
select *,character_length(用語) from 計算機用語
|
||||
用語 | 分類コード | 備考1aだよ | length
|
||||
----------------------------+------------+------------+--------
|
||||
コンピュータディスプレイ | 機A01上 | | 12
|
||||
コンピュータグラフィックス | 分B10中 | | 13
|
||||
コンピュータプログラマー | 人Z01下 | | 12
|
||||
select *,character_length(用語) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | char_length
|
||||
----------------------------+------------+------------+-------------
|
||||
コンピュータディスプレイ | 機A01上 | | 12
|
||||
コンピュータグラフィックス | 分B10中 | | 13
|
||||
コンピュータプログラマー | 人Z01下 | | 12
|
||||
(3 rows)
|
||||
|
||||
select *,octet_length(用語) from 計算機用語
|
||||
select *,octet_length(用語) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | octet_length
|
||||
----------------------------+------------+------------+--------------
|
||||
コンピュータディスプレイ | 機A01上 | | 24
|
||||
|
@ -69,7 +69,7 @@ select *,octet_length(
|
|||
コンピュータプログラマー | 人Z01下 | | 24
|
||||
(3 rows)
|
||||
|
||||
select *,position('デ' in 用語) from 計算機用語
|
||||
select *,position('デ' in 用語) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | strpos
|
||||
----------------------------+------------+------------+--------
|
||||
コンピュータディスプレイ | 機A01上 | | 7
|
||||
|
@ -77,7 +77,7 @@ select *,position('
|
|||
コンピュータプログラマー | 人Z01下 | | 0
|
||||
(3 rows)
|
||||
|
||||
select *,substring(用語 from 10 for 4) from 計算機用語
|
||||
select *,substring(用語 from 10 for 4) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | substr
|
||||
----------------------------+------------+------------+----------
|
||||
コンピュータディスプレイ | 機A01上 | | プレイ
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
drop table 計算機용어
|
||||
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 計算機용어
|
||||
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上 |
|
||||
|
@ -15,53 +15,53 @@ select * from ͪߩѦ
|
|||
컴퓨터프로그래머 | 人Z01下 |
|
||||
(3 rows)
|
||||
|
||||
select * from 計算機용어 where 分類코드 = '人Z01下'
|
||||
select * from 計算機용어 where 分類코드 = '人Z01下';
|
||||
용어 | 分類코드 | 비고1a라구
|
||||
------------------+----------+------------
|
||||
컴퓨터프로그래머 | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機용어 where 分類코드 ~* '人z01下'
|
||||
select * from 計算機용어 where 分類코드 ~* '人z01下';
|
||||
용어 | 分類코드 | 비고1a라구
|
||||
------------------+----------+------------
|
||||
컴퓨터프로그래머 | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機용어 where 分類코드 like '_Z01_'
|
||||
select * from 計算機용어 where 分類코드 like '_Z01_';
|
||||
용어 | 分類코드 | 비고1a라구
|
||||
------------------+----------+------------
|
||||
컴퓨터프로그래머 | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機용어 where 分類코드 like '_Z%'
|
||||
select * from 計算機용어 where 分類코드 like '_Z%';
|
||||
용어 | 分類코드 | 비고1a라구
|
||||
------------------+----------+------------
|
||||
컴퓨터프로그래머 | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機용어 where 용어 ~ '컴퓨터[디그]'
|
||||
select * from 計算機용어 where 용어 ~ '컴퓨터[디그]';
|
||||
용어 | 分類코드 | 비고1a라구
|
||||
------------------+----------+------------
|
||||
컴퓨터디스플레이 | 機A01上 |
|
||||
컴퓨터그래픽스 | 分B10中 |
|
||||
(2 rows)
|
||||
|
||||
select * from 計算機용어 where 용어 ~* '컴퓨터[디그]'
|
||||
select * from 計算機용어 where 용어 ~* '컴퓨터[디그]';
|
||||
용어 | 分類코드 | 비고1a라구
|
||||
------------------+----------+------------
|
||||
컴퓨터디스플레이 | 機A01上 |
|
||||
컴퓨터그래픽스 | 分B10中 |
|
||||
(2 rows)
|
||||
|
||||
select *,character_length(용어) from 計算機용어
|
||||
용어 | 分類코드 | 비고1a라구 | length
|
||||
------------------+----------+------------+--------
|
||||
컴퓨터디스플레이 | 機A01上 | | 8
|
||||
컴퓨터그래픽스 | 分B10中 | | 7
|
||||
컴퓨터프로그래머 | 人Z01下 | | 8
|
||||
select *,character_length(용어) from 計算機용어;
|
||||
용어 | 分類코드 | 비고1a라구 | char_length
|
||||
------------------+----------+------------+-------------
|
||||
컴퓨터디스플레이 | 機A01上 | | 8
|
||||
컴퓨터그래픽스 | 分B10中 | | 7
|
||||
컴퓨터프로그래머 | 人Z01下 | | 8
|
||||
(3 rows)
|
||||
|
||||
select *,octet_length(용어) from 計算機용어
|
||||
select *,octet_length(용어) from 計算機용어;
|
||||
용어 | 分類코드 | 비고1a라구 | octet_length
|
||||
------------------+----------+------------+--------------
|
||||
컴퓨터디스플레이 | 機A01上 | | 16
|
||||
|
@ -69,7 +69,7 @@ select *,octet_length(
|
|||
컴퓨터프로그래머 | 人Z01下 | | 16
|
||||
(3 rows)
|
||||
|
||||
select *,position('디' in 용어) from 計算機용어
|
||||
select *,position('디' in 용어) from 計算機용어;
|
||||
용어 | 分類코드 | 비고1a라구 | strpos
|
||||
------------------+----------+------------+--------
|
||||
컴퓨터디스플레이 | 機A01上 | | 4
|
||||
|
@ -77,7 +77,7 @@ select *,position('
|
|||
컴퓨터프로그래머 | 人Z01下 | | 0
|
||||
(3 rows)
|
||||
|
||||
select *,substring(용어 from 3 for 4) from 計算機용어
|
||||
select *,substring(용어 from 3 for 4) from 計算機용어;
|
||||
용어 | 分類코드 | 비고1a라구 | substr
|
||||
------------------+----------+------------+----------
|
||||
컴퓨터디스플레이 | 機A01上 | | 터디스플
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
drop table 燹俑骜砧
|
||||
drop table 燹俑骜砧;
|
||||
ERROR: Relation '燹俑骜砧' does not exist
|
||||
create table 燹俑骜砧 (如淦杀 text, 狞瞥婉螭 varchar, 氢蛇 varchar(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 燹俑骜砧
|
||||
create table 燹俑骜砧 (如淦杀 text, 狞瞥婉螭 varchar, 氢蛇 varchar(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 燹俑骜砧;
|
||||
如淦杀 | 狞瞥婉螭 | 氢蛇
|
||||
--------+------------------+---------
|
||||
缳妾淦 | 绠绠绎世 | 啤A01念
|
||||
|
@ -15,51 +15,51 @@ select * from
|
|||
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩
|
||||
(3 rows)
|
||||
|
||||
select * from 燹俑骜砧 where 氢蛇 = '仨Z01摩'
|
||||
select * from 燹俑骜砧 where 氢蛇 = '仨Z01摩';
|
||||
如淦杀 | 狞瞥婉螭 | 氢蛇
|
||||
--------+------------------+---------
|
||||
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩
|
||||
(1 row)
|
||||
|
||||
select * from 燹俑骜砧 where 氢蛇 ~* '仨z01摩'
|
||||
select * from 燹俑骜砧 where 氢蛇 ~* '仨z01摩';
|
||||
如淦杀 | 狞瞥婉螭 | 氢蛇
|
||||
--------+------------------+---------
|
||||
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩
|
||||
(1 row)
|
||||
|
||||
select * from 燹俑骜砧 where 氢蛇 like '_Z01_'
|
||||
select * from 燹俑骜砧 where 氢蛇 like '_Z01_';
|
||||
如淦杀 | 狞瞥婉螭 | 氢蛇
|
||||
--------+------------------+---------
|
||||
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩
|
||||
(1 row)
|
||||
|
||||
select * from 燹俑骜砧 where 氢蛇 like '_Z%'
|
||||
select * from 燹俑骜砧 where 氢蛇 like '_Z%';
|
||||
如淦杀 | 狞瞥婉螭 | 氢蛇
|
||||
--------+------------------+---------
|
||||
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩
|
||||
(1 row)
|
||||
|
||||
select * from 燹俑骜砧 where 狞瞥婉螭 ~ '绠绠绎[凫卮世]'
|
||||
select * from 燹俑骜砧 where 狞瞥婉螭 ~ '绠绠绎[凫卮世]';
|
||||
如淦杀 | 狞瞥婉螭 | 氢蛇
|
||||
--------+----------+---------
|
||||
缳妾淦 | 绠绠绎世 | 啤A01念
|
||||
(1 row)
|
||||
|
||||
select * from 燹俑骜砧 where 狞瞥婉螭 ~* '绠绠绎[凫卮世]'
|
||||
select * from 燹俑骜砧 where 狞瞥婉螭 ~* '绠绠绎[凫卮世]';
|
||||
如淦杀 | 狞瞥婉螭 | 氢蛇
|
||||
--------+----------+---------
|
||||
缳妾淦 | 绠绠绎世 | 啤A01念
|
||||
(1 row)
|
||||
|
||||
select *, character_length(如淦杀) from 燹俑骜砧
|
||||
如淦杀 | 狞瞥婉螭 | 氢蛇 | length
|
||||
--------+------------------+---------+--------
|
||||
缳妾淦 | 绠绠绎世 | 啤A01念 | 3
|
||||
犒葸淦 | 芈溷却宇狞瞥 | 你B10你 | 3
|
||||
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 | 3
|
||||
select *, character_length(如淦杀) from 燹俑骜砧;
|
||||
如淦杀 | 狞瞥婉螭 | 氢蛇 | char_length
|
||||
--------+------------------+---------+-------------
|
||||
缳妾淦 | 绠绠绎世 | 啤A01念 | 3
|
||||
犒葸淦 | 芈溷却宇狞瞥 | 你B10你 | 3
|
||||
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 | 3
|
||||
(3 rows)
|
||||
|
||||
select *, octet_length(如淦杀) from 燹俑骜砧
|
||||
select *, octet_length(如淦杀) from 燹俑骜砧;
|
||||
如淦杀 | 狞瞥婉螭 | 氢蛇 | octet_length
|
||||
--------+------------------+---------+--------------
|
||||
缳妾淦 | 绠绠绎世 | 啤A01念 | 6
|
||||
|
@ -67,7 +67,7 @@ select *, octet_length(
|
|||
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 | 6
|
||||
(3 rows)
|
||||
|
||||
select *, position('却宇' in 狞瞥婉螭) from 燹俑骜砧
|
||||
select *, position('却宇' in 狞瞥婉螭) from 燹俑骜砧;
|
||||
如淦杀 | 狞瞥婉螭 | 氢蛇 | strpos
|
||||
--------+------------------+---------+--------
|
||||
缳妾淦 | 绠绠绎世 | 啤A01念 | 0
|
||||
|
@ -75,7 +75,7 @@ select *, position('ȴ
|
|||
螫悖淦 | 印汤洗枪却宇狞瞥 | 仨Z01摩 | 5
|
||||
(3 rows)
|
||||
|
||||
select *, substring(狞瞥婉螭 from 3 for 6 ) from 燹俑骜砧
|
||||
select *, substring(狞瞥婉螭 from 3 for 6 ) from 燹俑骜砧;
|
||||
如淦杀 | 狞瞥婉螭 | 氢蛇 | substr
|
||||
--------+------------------+---------+--------------
|
||||
缳妾淦 | 绠绠绎世 | 啤A01念 | 绎世
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
drop table ’·×’»»’µ¡’ÍÑ’¸ì
|
||||
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 ’·×’»»’µ¡’ÍÑ’¸ì
|
||||
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’¾å |
|
||||
|
@ -15,53 +15,53 @@ select * from
|
|||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ |
|
||||
(3 rows)
|
||||
|
||||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É = '’¿ÍZ01’²¼'
|
||||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É = '’¿ÍZ01’²¼';
|
||||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è
|
||||
--------------------------------------+-----------------+----------------
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ |
|
||||
(1 row)
|
||||
|
||||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É ~* '’¿Íz01’²¼'
|
||||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É ~* '’¿Íz01’²¼';
|
||||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è
|
||||
--------------------------------------+-----------------+----------------
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ |
|
||||
(1 row)
|
||||
|
||||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É like '_Z01_'
|
||||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É like '_Z01_';
|
||||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è
|
||||
--------------------------------------+-----------------+----------------
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ |
|
||||
(1 row)
|
||||
|
||||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É like '_Z%'
|
||||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ʬ’Îà’¥³’¡¼’¥É like '_Z%';
|
||||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è
|
||||
--------------------------------------+-----------------+----------------
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ |
|
||||
(1 row)
|
||||
|
||||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~ '’¥³’¥ó’¥Ô’¥å’¡¼’¥¿[’¥Ç’¥°]'
|
||||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~ '’¥³’¥ó’¥Ô’¥å’¡¼’¥¿[’¥Ç’¥°]';
|
||||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è
|
||||
-----------------------------------------+-----------------+----------------
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å |
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹ | ’ʬB10’Ãæ |
|
||||
(2 rows)
|
||||
|
||||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~* '’¥³’¥ó’¥Ô’¥å’¡¼’¥¿[’¥Ç’¥°]'
|
||||
select * from ’·×’»»’µ¡’ÍÑ’¸ì where ’ÍÑ’¸ì ~* '’¥³’¥ó’¥Ô’¥å’¡¼’¥¿[’¥Ç’¥°]';
|
||||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è
|
||||
-----------------------------------------+-----------------+----------------
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å |
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹ | ’ʬB10’Ãæ |
|
||||
(2 rows)
|
||||
|
||||
select *,character_length(’ÍÑ’¸ì) from ’·×’»»’µ¡’ÍÑ’¸ì
|
||||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è | length
|
||||
-----------------------------------------+-----------------+----------------+--------
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å | | 12
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹ | ’ʬB10’Ãæ | | 13
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ | | 12
|
||||
select *,character_length(’ÍÑ’¸ì) from ’·×’»»’µ¡’ÍÑ’¸ì;
|
||||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è | char_length
|
||||
-----------------------------------------+-----------------+----------------+-------------
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å | | 12
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥°’¥é’¥Õ’¥£’¥Ã’¥¯’¥¹ | ’ʬB10’Ãæ | | 13
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ | | 12
|
||||
(3 rows)
|
||||
|
||||
select *,octet_length(’ÍÑ’¸ì) from ’·×’»»’µ¡’ÍÑ’¸ì
|
||||
select *,octet_length(’ÍÑ’¸ì) from ’·×’»»’µ¡’ÍÑ’¸ì;
|
||||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è | octet_length
|
||||
-----------------------------------------+-----------------+----------------+--------------
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å | | 36
|
||||
|
@ -69,7 +69,7 @@ select *,octet_length(
|
|||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ | | 36
|
||||
(3 rows)
|
||||
|
||||
select *,position('’¥Ç' in ’ÍÑ’¸ì) from ’·×’»»’µ¡’ÍÑ’¸ì
|
||||
select *,position('’¥Ç' in ’ÍÑ’¸ì) from ’·×’»»’µ¡’ÍÑ’¸ì;
|
||||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è | strpos
|
||||
-----------------------------------------+-----------------+----------------+--------
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å | | 7
|
||||
|
@ -77,7 +77,7 @@ select *,position('
|
|||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ | | 0
|
||||
(3 rows)
|
||||
|
||||
select *,substring(’ÍÑ’¸ì from 10 for 4) from ’·×’»»’µ¡’ÍÑ’¸ì
|
||||
select *,substring(’ÍÑ’¸ì from 10 for 4) from ’·×’»»’µ¡’ÍÑ’¸ì;
|
||||
’ÍÑ’¸ì | ’ʬ’Îà’¥³’¡¼’¥É | ’È÷’¹Í1a’¤À’¤è | substr
|
||||
-----------------------------------------+-----------------+----------------+--------------
|
||||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥Ç’¥£’¥¹’¥×’¥ì’¥¤ | ’µ¡A01’¾å | | ’¥×’¥ì’¥¤
|
||||
|
@ -85,16 +85,16 @@ select *,substring(
|
|||
’¥³’¥ó’¥Ô’¥å’¡¼’¥¿’¥×’¥í’¥°’¥é’¥Þ’¡¼ | ’¿ÍZ01’²¼ | | ’¥é’¥Þ’¡¼
|
||||
(3 rows)
|
||||
|
||||
drop table ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï
|
||||
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 btree(‘·Ö‘Àà‘ºÅ)
|
||||
insert into ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï values('‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ','‘»úA01‘ÉÏ')
|
||||
insert into ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï values('‘µç‘Äԑͼ‘ÐÎ','‘·ÖB01‘ÖÐ')
|
||||
insert into ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï values('‘µç‘ÄÔ‘³Ì‘Ðò‘Ô±','‘ÈËZ01‘ÏÂ')
|
||||
vacuum ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï
|
||||
create table ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï(‘Êõ‘Óï text, ‘·Ö‘Àà‘ºÅ varchar, ‘±¸‘×¢1A char(16));
|
||||
create index ‘¼Æ‘Ëã‘»ú‘Êõ‘Óïindex1 on ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï using btree(‘Êõ‘Óï);
|
||||
create index ‘¼Æ‘Ëã‘»ú‘Êõ‘Óïindex2 on ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï using btree(‘·Ö‘Àà‘ºÅ);
|
||||
insert into ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï values('‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ','‘»úA01‘ÉÏ');
|
||||
insert into ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï values('‘µç‘Äԑͼ‘ÐÎ','‘·ÖB01‘ÖÐ');
|
||||
insert into ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï values('‘µç‘ÄÔ‘³Ì‘Ðò‘Ô±','‘ÈËZ01‘ÏÂ');
|
||||
vacuum ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï;
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï;
|
||||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||||
-----------------+-----------+----------
|
||||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ |
|
||||
|
@ -102,53 +102,53 @@ select * from
|
|||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï |
|
||||
(3 rows)
|
||||
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘·Ö‘Àà‘ºÅ = '‘ÈËZ01‘ÏÂ'
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘·Ö‘Àà‘ºÅ = '‘ÈËZ01‘ÏÂ';
|
||||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||||
-----------------+-----------+----------
|
||||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï |
|
||||
(1 row)
|
||||
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘·Ö‘Àà‘ºÅ ~* '‘ÈËz01‘ÏÂ'
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘·Ö‘Àà‘ºÅ ~* '‘ÈËz01‘ÏÂ';
|
||||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||||
-----------------+-----------+----------
|
||||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï |
|
||||
(1 row)
|
||||
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘·Ö‘Àà‘ºÅ like '_Z01_'
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘·Ö‘Àà‘ºÅ like '_Z01_';
|
||||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||||
-----------------+-----------+----------
|
||||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï |
|
||||
(1 row)
|
||||
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘·Ö‘Àà‘ºÅ like '_Z%'
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘·Ö‘Àà‘ºÅ like '_Z%';
|
||||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||||
-----------------+-----------+----------
|
||||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï |
|
||||
(1 row)
|
||||
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘Êõ‘Óï ~ '‘µç‘ÄÔ[‘Ïԑͼ]'
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘Êõ‘Óï ~ '‘µç‘ÄÔ[‘Ïԑͼ]';
|
||||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||||
-----------------+-----------+----------
|
||||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ |
|
||||
‘µç‘Äԑͼ‘ÐÎ | ‘·ÖB01‘ÖÐ |
|
||||
(2 rows)
|
||||
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘Êõ‘Óï ~* '‘µç‘ÄÔ[‘Ïԑͼ]'
|
||||
select * from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï where ‘Êõ‘Óï ~* '‘µç‘ÄÔ[‘Ïԑͼ]';
|
||||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a
|
||||
-----------------+-----------+----------
|
||||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ |
|
||||
‘µç‘Äԑͼ‘ÐÎ | ‘·ÖB01‘ÖÐ |
|
||||
(2 rows)
|
||||
|
||||
select *,character_length(‘Êõ‘Óï) from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï
|
||||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a | length
|
||||
-----------------+-----------+----------+--------
|
||||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ | | 5
|
||||
‘µç‘Äԑͼ‘ÐÎ | ‘·ÖB01‘ÖÐ | | 4
|
||||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï | | 5
|
||||
select *,character_length(‘Êõ‘Óï) from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï;
|
||||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a | char_length
|
||||
-----------------+-----------+----------+-------------
|
||||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ | | 5
|
||||
‘µç‘Äԑͼ‘ÐÎ | ‘·ÖB01‘ÖÐ | | 4
|
||||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï | | 5
|
||||
(3 rows)
|
||||
|
||||
select *,octet_length(‘Êõ‘Óï) from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï
|
||||
select *,octet_length(‘Êõ‘Óï) from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï;
|
||||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a | octet_length
|
||||
-----------------+-----------+----------+--------------
|
||||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ | | 15
|
||||
|
@ -156,7 +156,7 @@ select *,octet_length(
|
|||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï | | 15
|
||||
(3 rows)
|
||||
|
||||
select *,position('‘ÏÔ' in ‘Êõ‘Óï) from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï
|
||||
select *,position('‘ÏÔ' in ‘Êõ‘Óï) from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï;
|
||||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a | strpos
|
||||
-----------------+-----------+----------+--------
|
||||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ | | 3
|
||||
|
@ -164,7 +164,7 @@ select *,position('
|
|||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï | | 0
|
||||
(3 rows)
|
||||
|
||||
select *,substring(‘Êõ‘Óï from 3 for 4) from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï
|
||||
select *,substring(‘Êõ‘Óï from 3 for 4) from ‘¼Æ‘Ëã‘»ú‘Êõ‘Óï;
|
||||
‘Êõ‘Óï | ‘·Ö‘Àà‘ºÅ | ‘±¸‘×¢1a | substr
|
||||
-----------------+-----------+----------+-----------
|
||||
‘µç‘ÄÔ‘Ïԑʾ‘ÆÁ | ‘»úA01‘ÉÏ | | ‘Ïԑʾ‘ÆÁ
|
||||
|
@ -172,16 +172,16 @@ select *,substring(
|
|||
‘µç‘ÄÔ‘³Ì‘Ðò‘Ô± | ‘ÈËZ01‘Ï | | ‘³Ì‘Ðò‘Ô±
|
||||
(3 rows)
|
||||
|
||||
drop table “ͪ“ß©“Ѧ“¿ë“¾î
|
||||
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 “ͪ“ß©“Ѧ“¿ë“¾î
|
||||
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“ß¾ |
|
||||
|
@ -189,53 +189,53 @@ select * from
|
|||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» |
|
||||
(3 rows)
|
||||
|
||||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “Ý“׾“ÄÚ“µå = '“ìÑZ01“ù»'
|
||||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “Ý“׾“ÄÚ“µå = '“ìÑZ01“ù»';
|
||||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸
|
||||
--------------------------+--------------+----------------
|
||||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» |
|
||||
(1 row)
|
||||
|
||||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “Ý“׾“ÄÚ“µå ~* '“ìÑz01“ù»'
|
||||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “Ý“׾“ÄÚ“µå ~* '“ìÑz01“ù»';
|
||||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸
|
||||
--------------------------+--------------+----------------
|
||||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» |
|
||||
(1 row)
|
||||
|
||||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “Ý“׾“ÄÚ“µå like '_Z01_'
|
||||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “Ý“׾“ÄÚ“µå like '_Z01_';
|
||||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸
|
||||
--------------------------+--------------+----------------
|
||||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» |
|
||||
(1 row)
|
||||
|
||||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “Ý“׾“ÄÚ“µå like '_Z%'
|
||||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “Ý“׾“ÄÚ“µå like '_Z%';
|
||||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸
|
||||
--------------------------+--------------+----------------
|
||||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» |
|
||||
(1 row)
|
||||
|
||||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “¿ë“¾î ~ '“ÄÄ“Ç»“ÅÍ[“µð“±×]'
|
||||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “¿ë“¾î ~ '“ÄÄ“Ç»“ÅÍ[“µð“±×]';
|
||||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸
|
||||
--------------------------+--------------+----------------
|
||||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ |
|
||||
“ÄÄ“Ç»“ÅÍ“±×“·¡“ÇÈ“½º | “ÝÂB10“ñé |
|
||||
(2 rows)
|
||||
|
||||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “¿ë“¾î ~* '“ÄÄ“Ç»“ÅÍ[“µð“±×]'
|
||||
select * from “ͪ“ß©“Ѧ“¿ë“¾î where “¿ë“¾î ~* '“ÄÄ“Ç»“ÅÍ[“µð“±×]';
|
||||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸
|
||||
--------------------------+--------------+----------------
|
||||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ |
|
||||
“ÄÄ“Ç»“ÅÍ“±×“·¡“ÇÈ“½º | “ÝÂB10“ñé |
|
||||
(2 rows)
|
||||
|
||||
select *,character_length(“¿ë“¾î) from “ͪ“ß©“Ѧ“¿ë“¾î
|
||||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸ | length
|
||||
--------------------------+--------------+----------------+--------
|
||||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ | | 8
|
||||
“ÄÄ“Ç»“ÅÍ“±×“·¡“ÇÈ“½º | “ÝÂB10“ñé | | 7
|
||||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» | | 8
|
||||
select *,character_length(“¿ë“¾î) from “ͪ“ß©“Ѧ“¿ë“¾î;
|
||||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸ | char_length
|
||||
--------------------------+--------------+----------------+-------------
|
||||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ | | 8
|
||||
“ÄÄ“Ç»“ÅÍ“±×“·¡“ÇÈ“½º | “ÝÂB10“ñé | | 7
|
||||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» | | 8
|
||||
(3 rows)
|
||||
|
||||
select *,octet_length(“¿ë“¾î) from “ͪ“ß©“Ѧ“¿ë“¾î
|
||||
select *,octet_length(“¿ë“¾î) from “ͪ“ß©“Ѧ“¿ë“¾î;
|
||||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸ | octet_length
|
||||
--------------------------+--------------+----------------+--------------
|
||||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ | | 24
|
||||
|
@ -243,7 +243,7 @@ select *,octet_length(
|
|||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» | | 24
|
||||
(3 rows)
|
||||
|
||||
select *,position('“µð' in “¿ë“¾î) from “ͪ“ß©“Ѧ“¿ë“¾î
|
||||
select *,position('“µð' in “¿ë“¾î) from “ͪ“ß©“Ѧ“¿ë“¾î;
|
||||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸ | strpos
|
||||
--------------------------+--------------+----------------+--------
|
||||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ | | 4
|
||||
|
@ -251,7 +251,7 @@ select *,position('
|
|||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» | | 0
|
||||
(3 rows)
|
||||
|
||||
select *,substring(“¿ë“¾î from 3 for 4) from “ͪ“ß©“Ѧ“¿ë“¾î
|
||||
select *,substring(“¿ë“¾î from 3 for 4) from “ͪ“ß©“Ѧ“¿ë“¾î;
|
||||
“¿ë“¾î | “Ý“׾“ÄÚ“µå | “ºñ“°í1a“¶ó“±¸ | substr
|
||||
--------------------------+--------------+----------------+--------------
|
||||
“ÄÄ“Ç»“ÅÍ“µð“½º“ÇÓ·¹“ÀÌ | “ѦA01“ß¾ | | “ÅÍ“µð“½º“ÇÃ
|
||||
|
@ -259,16 +259,16 @@ select *,substring(
|
|||
“ÄÄ“Ç»“ÅÍ“ÇÁ“·Î“±×“·¡“¸Ó | “ìÑZ01“ù» | | “ÅÍ“ÇÁ“·Î“±×
|
||||
(3 rows)
|
||||
|
||||
drop table test
|
||||
drop table test;
|
||||
ERROR: Relation 'test' does not exist
|
||||
create table test (t text)
|
||||
insert into test values('ENGLISH')
|
||||
insert into test values('FRAN<41>ÇAIS')
|
||||
insert into test values('ESPA<50>ÑOL')
|
||||
insert into test values('<27>ÍSLENSKA')
|
||||
insert into test values('ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA')
|
||||
vacuum test
|
||||
select * from test
|
||||
create table test (t text);
|
||||
insert into test values('ENGLISH');
|
||||
insert into test values('FRAN<41>ÇAIS');
|
||||
insert into test values('ESPA<50>ÑOL');
|
||||
insert into test values('<27>ÍSLENSKA');
|
||||
insert into test values('ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA');
|
||||
vacuum test;
|
||||
select * from test;
|
||||
t
|
||||
--------------------------------------
|
||||
ENGLISH
|
||||
|
@ -278,30 +278,30 @@ select * from test
|
|||
ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA
|
||||
(5 rows)
|
||||
|
||||
select * from test where t = 'ESPA<50>ÑOL'
|
||||
select * from test where t = 'ESPA<50>ÑOL';
|
||||
t
|
||||
----------
|
||||
ESPA<50>ÑOL
|
||||
(1 row)
|
||||
|
||||
select * from test where t ~* 'espa<70>Ñol'
|
||||
select * from test where t ~* 'espa<70>Ñol';
|
||||
t
|
||||
--------------------------------------
|
||||
ESPA<50>ÑOL
|
||||
ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA
|
||||
(2 rows)
|
||||
|
||||
select *,character_length(t) from test
|
||||
t | length
|
||||
--------------------------------------+--------
|
||||
ENGLISH | 7
|
||||
FRAN<41>ÇAIS | 8
|
||||
ESPA<50>ÑOL | 7
|
||||
<20>ÍSLENSKA | 8
|
||||
ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA | 33
|
||||
select *,character_length(t) from test;
|
||||
t | char_length
|
||||
--------------------------------------+-------------
|
||||
ENGLISH | 7
|
||||
FRAN<41>ÇAIS | 8
|
||||
ESPA<50>ÑOL | 7
|
||||
<20>ÍSLENSKA | 8
|
||||
ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA | 33
|
||||
(5 rows)
|
||||
|
||||
select *,octet_length(t) from test
|
||||
select *,octet_length(t) from test;
|
||||
t | octet_length
|
||||
--------------------------------------+--------------
|
||||
ENGLISH | 7
|
||||
|
@ -311,7 +311,7 @@ select *,octet_length(t) from test
|
|||
ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA | 36
|
||||
(5 rows)
|
||||
|
||||
select *,position('L' in t) from test
|
||||
select *,position('L' in t) from test;
|
||||
t | strpos
|
||||
--------------------------------------+--------
|
||||
ENGLISH | 4
|
||||
|
@ -321,7 +321,7 @@ select *,position('L' in t) from test
|
|||
ENGLISH FRAN<41>ÇAIS ESPA<50>ÑOL <20>ÍSLENSKA | 4
|
||||
(5 rows)
|
||||
|
||||
select *,substring(t from 3 for 4) from test
|
||||
select *,substring(t from 3 for 4) from test;
|
||||
t | substr
|
||||
--------------------------------------+--------
|
||||
ENGLISH | GLIS
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
drop table 計算機用語
|
||||
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 計算機用語
|
||||
drop table 計算機用語;
|
||||
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上 |
|
||||
|
@ -14,53 +14,53 @@ select * from
|
|||
コンピュータプログラマー | 人Z01下 |
|
||||
(3 rows)
|
||||
|
||||
select * from 計算機用語 where 分類コード = '人Z01下'
|
||||
select * from 計算機用語 where 分類コード = '人Z01下';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------+------------+------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 分類コード ~* '人z01下'
|
||||
select * from 計算機用語 where 分類コード ~* '人z01下';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------+------------+------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 分類コード like '_Z01_'
|
||||
select * from 計算機用語 where 分類コード like '_Z01_';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------+------------+------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 分類コード like '_Z%'
|
||||
select * from 計算機用語 where 分類コード like '_Z%';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------+------------+------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]'
|
||||
select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
----------------------------+------------+------------
|
||||
コンピュータディスプレイ | 機A01上 |
|
||||
コンピュータグラフィックス | 分B10中 |
|
||||
(2 rows)
|
||||
|
||||
select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]'
|
||||
select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
----------------------------+------------+------------
|
||||
コンピュータディスプレイ | 機A01上 |
|
||||
コンピュータグラフィックス | 分B10中 |
|
||||
(2 rows)
|
||||
|
||||
select *,character_length(用語) from 計算機用語
|
||||
用語 | 分類コード | 備考1aだよ | length
|
||||
----------------------------+------------+------------+--------
|
||||
コンピュータディスプレイ | 機A01上 | | 12
|
||||
コンピュータグラフィックス | 分B10中 | | 13
|
||||
コンピュータプログラマー | 人Z01下 | | 12
|
||||
select *,character_length(用語) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | char_length
|
||||
----------------------------+------------+------------+-------------
|
||||
コンピュータディスプレイ | 機A01上 | | 12
|
||||
コンピュータグラフィックス | 分B10中 | | 13
|
||||
コンピュータプログラマー | 人Z01下 | | 12
|
||||
(3 rows)
|
||||
|
||||
select *,octet_length(用語) from 計算機用語
|
||||
select *,octet_length(用語) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | octet_length
|
||||
----------------------------+------------+------------+--------------
|
||||
コンピュータディスプレイ | 機A01上 | | 24
|
||||
|
@ -68,7 +68,7 @@ select *,octet_length(
|
|||
コンピュータプログラマー | 人Z01下 | | 24
|
||||
(3 rows)
|
||||
|
||||
select *,position('デ' in 用語) from 計算機用語
|
||||
select *,position('デ' in 用語) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | strpos
|
||||
----------------------------+------------+------------+--------
|
||||
コンピュータディスプレイ | 機A01上 | | 7
|
||||
|
@ -76,7 +76,7 @@ select *,position('
|
|||
コンピュータプログラマー | 人Z01下 | | 0
|
||||
(3 rows)
|
||||
|
||||
select *,substring(用語 from 10 for 4) from 計算機用語
|
||||
select *,substring(用語 from 10 for 4) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | substr
|
||||
----------------------------+------------+------------+----------
|
||||
コンピュータディスプレイ | 機A01上 | | プレイ
|
||||
|
@ -84,7 +84,7 @@ select *,substring(
|
|||
コンピュータプログラマー | 人Z01下 | | ラマー
|
||||
(3 rows)
|
||||
|
||||
copy 計算機用語 to stdout
|
||||
copy 計算機用語 to stdout;
|
||||
コンピュータディスプレイ 機A01上 \N
|
||||
コンピュータグラフィックス 分B10中 \N
|
||||
コンピュータプログラマー 人Z01下 \N
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
drop table 計算機用語
|
||||
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 計算機用語
|
||||
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上 |
|
||||
|
@ -15,53 +15,53 @@ select * from 計算機用語
|
|||
コンピュータプログラマー | 人Z01下 |
|
||||
(3 rows)
|
||||
|
||||
select * from 計算機用語 where 分類コード = '人Z01下'
|
||||
select * from 計算機用語 where 分類コード = '人Z01下';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------------------+-----------------+----------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 分類コード ~* '人z01下'
|
||||
select * from 計算機用語 where 分類コード ~* '人z01下';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------------------+-----------------+----------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 分類コード like '_Z01_'
|
||||
select * from 計算機用語 where 分類コード like '_Z01_';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------------------+-----------------+----------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 分類コード like '_Z%'
|
||||
select * from 計算機用語 where 分類コード like '_Z%';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
--------------------------------------+-----------------+----------------
|
||||
コンピュータプログラマー | 人Z01下 |
|
||||
(1 row)
|
||||
|
||||
select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]'
|
||||
select * from 計算機用語 where 用語 ~ 'コンピュータ[デグ]';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
-----------------------------------------+-----------------+----------------
|
||||
コンピュータディスプレイ | 機A01上 |
|
||||
コンピュータグラフィックス | 分B10中 |
|
||||
(2 rows)
|
||||
|
||||
select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]'
|
||||
select * from 計算機用語 where 用語 ~* 'コンピュータ[デグ]';
|
||||
用語 | 分類コード | 備考1aだよ
|
||||
-----------------------------------------+-----------------+----------------
|
||||
コンピュータディスプレイ | 機A01上 |
|
||||
コンピュータグラフィックス | 分B10中 |
|
||||
(2 rows)
|
||||
|
||||
select *,character_length(用語) from 計算機用語
|
||||
用語 | 分類コード | 備考1aだよ | length
|
||||
-----------------------------------------+-----------------+----------------+--------
|
||||
コンピュータディスプレイ | 機A01上 | | 12
|
||||
コンピュータグラフィックス | 分B10中 | | 13
|
||||
コンピュータプログラマー | 人Z01下 | | 12
|
||||
select *,character_length(用語) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | char_length
|
||||
-----------------------------------------+-----------------+----------------+-------------
|
||||
コンピュータディスプレイ | 機A01上 | | 12
|
||||
コンピュータグラフィックス | 分B10中 | | 13
|
||||
コンピュータプログラマー | 人Z01下 | | 12
|
||||
(3 rows)
|
||||
|
||||
select *,octet_length(用語) from 計算機用語
|
||||
select *,octet_length(用語) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | octet_length
|
||||
-----------------------------------------+-----------------+----------------+--------------
|
||||
コンピュータディスプレイ | 機A01上 | | 36
|
||||
|
@ -69,7 +69,7 @@ select *,octet_length(用語) from 計算機用語
|
|||
コンピュータプログラマー | 人Z01下 | | 36
|
||||
(3 rows)
|
||||
|
||||
select *,position('デ' in 用語) from 計算機用語
|
||||
select *,position('デ' in 用語) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | strpos
|
||||
-----------------------------------------+-----------------+----------------+--------
|
||||
コンピュータディスプレイ | 機A01上 | | 7
|
||||
|
@ -77,7 +77,7 @@ select *,position('デ' in 用語) from 計算機用語
|
|||
コンピュータプログラマー | 人Z01下 | | 0
|
||||
(3 rows)
|
||||
|
||||
select *,substring(用語 from 10 for 4) from 計算機用語
|
||||
select *,substring(用語 from 10 for 4) from 計算機用語;
|
||||
用語 | 分類コード | 備考1aだよ | substr
|
||||
-----------------------------------------+-----------------+----------------+--------------
|
||||
コンピュータディスプレイ | 機A01上 | | プレイ
|
||||
|
|
Loading…
Reference in a new issue