blob: 99eb4884e12668fe9c4abbe0ab21bbf12fb2e697 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
drop table ��ٸ����;
ERROR: table "��ٸ����" 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 ��ٸ����;
����ɱ | ��Ƴ��� | ����
--------+------------------+---------
����� | ������ | ơA01��
������ | ����ȴ����Ƴ | ��B10��
���� | ӡ��ϴǹȴ����Ƴ | ��Z01Ħ
(3 rows)
select * from ��ٸ���� where ���� = '��Z01Ħ';
����ɱ | ��Ƴ��� | ����
--------+------------------+---------
���� | ӡ��ϴǹȴ����Ƴ | ��Z01Ħ
(1 row)
select * from ��ٸ���� where ���� ~* '��z01Ħ';
����ɱ | ��Ƴ��� | ����
--------+------------------+---------
���� | ӡ��ϴǹȴ����Ƴ | ��Z01Ħ
(1 row)
select * from ��ٸ���� where ���� like '_Z01_';
����ɱ | ��Ƴ��� | ����
--------+------------------+---------
���� | ӡ��ϴǹȴ����Ƴ | ��Z01Ħ
(1 row)
select * from ��ٸ���� where ���� like '_Z%';
����ɱ | ��Ƴ��� | ����
--------+------------------+---------
���� | ӡ��ϴǹȴ����Ƴ | ��Z01Ħ
(1 row)
select * from ��ٸ���� where ��Ƴ��� ~ '����[��ش��]';
����ɱ | ��Ƴ��� | ����
--------+----------+---------
����� | ������ | ơA01��
(1 row)
select * from ��ٸ���� where ��Ƴ��� ~* '����[��ش��]';
����ɱ | ��Ƴ��� | ����
--------+----------+---------
����� | ������ | ơA01��
(1 row)
select *, character_length(����ɱ) from ��ٸ����;
����ɱ | ��Ƴ��� | ���� | character_length
--------+------------------+---------+------------------
����� | ������ | ơA01�� | 3
������ | ����ȴ����Ƴ | ��B10�� | 3
���� | ӡ��ϴǹȴ����Ƴ | ��Z01Ħ | 3
(3 rows)
select *, octet_length(����ɱ) from ��ٸ����;
����ɱ | ��Ƴ��� | ���� | octet_length
--------+------------------+---------+--------------
����� | ������ | ơA01�� | 6
������ | ����ȴ����Ƴ | ��B10�� | 6
���� | ӡ��ϴǹȴ����Ƴ | ��Z01Ħ | 6
(3 rows)
select *, position('ȴ��' in ��Ƴ���) from ��ٸ����;
����ɱ | ��Ƴ��� | ���� | position
--------+------------------+---------+----------
����� | ������ | ơA01�� | 0
������ | ����ȴ����Ƴ | ��B10�� | 3
���� | ӡ��ϴǹȴ����Ƴ | ��Z01Ħ | 5
(3 rows)
select *, substring(��Ƴ��� from 3 for 6 ) from ��ٸ����;
����ɱ | ��Ƴ��� | ���� | substring
--------+------------------+---------+--------------
����� | ������ | ơA01�� | ����
������ | ����ȴ����Ƴ | ��B10�� | ȴ����Ƴ
���� | ӡ��ϴǹȴ����Ƴ | ��Z01Ħ | ϴǹȴ����Ƴ
(3 rows)
|