blob: 4e2d10019962d0b902f1f6d97c51551afdd4a9cf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
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 廠商資料;
select * from 廠商資料 where 地址 = '高Z01九';
select * from 廠商資料 where 地址 ~* '高z01九';
select * from 廠商資料 where 地址 like '_Z01_';
select * from 廠商資料 where 地址 like '_Z%';
select * from 廠商資料 where 公司抬頭 ~ '達達科[寄記技]';
select * from 廠商資料 where 公司抬頭 ~* '達達科[寄記技]';
select *, character_length(行業別) from 廠商資料;
select *, octet_length(行業別) from 廠商資料;
select *, position('有限' in 公司抬頭) from 廠商資料;
select *, substring(公司抬頭 from 3 for 6 ) from 廠商資料;
|