1
drop table ��ג�������ђ��;
2
ERROR: Relation '��ג�������ђ��' does not exist
3
create table ��ג�������ђ�� (��ђ�� text, �ʬ������������ varchar, ������1A������ char(16));
4
create index ��ג�������ђ��index1 on ��ג�������ђ�� using btree (��ђ��);
5
create index ��ג�������ђ��index2 on ��ג�������ђ�� using hash (�ʬ������������);
6
insert into ��ג�������ђ�� values('������Ԓ�咡������ǒ�������ג�쒥�','���A01���');
7
insert into ��ג�������ђ�� values('������Ԓ�咡���������钥Ւ����Ò�����','�ʬB10���');
8
insert into ��ג�������ђ�� values('������Ԓ�咡������ג�풥���钥ޒ��','���Z01���');
10
select * from ��ג�������ђ��;
11
��ђ�� | �ʬ������������ | ������1a������
12
-----------------------------------------+-----------------+----------------
13
������Ԓ�咡������ǒ�������ג�쒥� | ���A01��� |
14
������Ԓ�咡���������钥Ւ����Ò����� | �ʬB10��� |
15
������Ԓ�咡������ג�풥���钥ޒ�� | ���Z01��� |
18
select * from ��ג�������ђ�� where �ʬ������������ = '���Z01���';
19
��ђ�� | �ʬ������������ | ������1a������
20
--------------------------------------+-----------------+----------------
21
������Ԓ�咡������ג�풥���钥ޒ�� | ���Z01��� |
24
select * from ��ג�������ђ�� where �ʬ������������ ~* '���z01���';
25
��ђ�� | �ʬ������������ | ������1a������
26
--------------------------------------+-----------------+----------------
27
������Ԓ�咡������ג�풥���钥ޒ�� | ���Z01��� |
30
select * from ��ג�������ђ�� where �ʬ������������ like '_Z01_';
31
��ђ�� | �ʬ������������ | ������1a������
32
--------------------------------------+-----------------+----------------
33
������Ԓ�咡������ג�풥���钥ޒ�� | ���Z01��� |
36
select * from ��ג�������ђ�� where �ʬ������������ like '_Z%';
37
��ђ�� | �ʬ������������ | ������1a������
38
--------------------------------------+-----------------+----------------
39
������Ԓ�咡������ג�풥���钥ޒ�� | ���Z01��� |
42
select * from ��ג�������ђ�� where ��ђ�� ~ '������Ԓ�咡����[��ǒ��]';
43
��ђ�� | �ʬ������������ | ������1a������
44
-----------------------------------------+-----------------+----------------
45
������Ԓ�咡������ǒ�������ג�쒥� | ���A01��� |
46
������Ԓ�咡���������钥Ւ����Ò����� | �ʬB10��� |
49
select * from ��ג�������ђ�� where ��ђ�� ~* '������Ԓ�咡����[��ǒ��]';
50
��ђ�� | �ʬ������������ | ������1a������
51
-----------------------------------------+-----------------+----------------
52
������Ԓ�咡������ǒ�������ג�쒥� | ���A01��� |
53
������Ԓ�咡���������钥Ւ����Ò����� | �ʬB10��� |
56
select *,character_length(��ђ��) from ��ג�������ђ��;
57
��ђ�� | �ʬ������������ | ������1a������ | char_length
58
-----------------------------------------+-----------------+----------------+-------------
59
������Ԓ�咡������ǒ�������ג�쒥� | ���A01��� | | 12
60
������Ԓ�咡���������钥Ւ����Ò����� | �ʬB10��� | | 13
61
������Ԓ�咡������ג�풥���钥ޒ�� | ���Z01��� | | 12
64
select *,octet_length(��ђ��) from ��ג�������ђ��;
65
��ђ�� | �ʬ������������ | ������1a������ | octet_length
66
-----------------------------------------+-----------------+----------------+--------------
67
������Ԓ�咡������ǒ�������ג�쒥� | ���A01��� | | 36
68
������Ԓ�咡���������钥Ւ����Ò����� | �ʬB10��� | | 39
69
������Ԓ�咡������ג�풥���钥ޒ�� | ���Z01��� | | 36
72
select *,position('���' in ��ђ��) from ��ג�������ђ��;
73
��ђ�� | �ʬ������������ | ������1a������ | strpos
74
-----------------------------------------+-----------------+----------------+--------
75
������Ԓ�咡������ǒ�������ג�쒥� | ���A01��� | | 7
76
������Ԓ�咡���������钥Ւ����Ò����� | �ʬB10��� | | 0
77
������Ԓ�咡������ג�풥���钥ޒ�� | ���Z01��� | | 0
80
select *,substring(��ђ�� from 10 for 4) from ��ג�������ђ��;
81
��ђ�� | �ʬ������������ | ������1a������ | substr
82
-----------------------------------------+-----------------+----------------+--------------
83
������Ԓ�咡������ǒ�������ג�쒥� | ���A01��� | | ��ג�쒥�
84
������Ԓ�咡���������钥Ւ����Ò����� | �ʬB10��� | | �����Ò�����
85
������Ԓ�咡������ג�풥���钥ޒ�� | ���Z01��� | | ��钥ޒ��
88
drop table ��Ƒ�㑻�������;
89
ERROR: Relation '��Ƒ�㑻�������' does not exist
90
create table ��Ƒ�㑻�������(������ text, ��֑����� varchar, ����ע1A char(16));
91
create index ��Ƒ�㑻�������index1 on ��Ƒ�㑻������� using btree(������);
92
create index ��Ƒ�㑻�������index2 on ��Ƒ�㑻������� using btree(��֑�����);
93
insert into ��Ƒ�㑻������� values('����ԑ�ԑʾ���','���A01���');
94
insert into ��Ƒ�㑻������� values('����ԑͼ���','���B01���');
95
insert into ��Ƒ�㑻������� values('����ԑ�̑��Ա','���Z01���');
97
select * from ��Ƒ�㑻�������;
98
������ | ��֑����� | ����ע1a
99
-----------------+-----------+----------
100
����ԑ�ԑʾ��� | ���A01��� |
101
����ԑͼ��� | ���B01��� |
102
����ԑ�̑��Ա | ���Z01��� |
105
select * from ��Ƒ�㑻������� where ��֑����� = '���Z01���';
106
������ | ��֑����� | ����ע1a
107
-----------------+-----------+----------
108
����ԑ�̑��Ա | ���Z01��� |
111
select * from ��Ƒ�㑻������� where ��֑����� ~* '���z01���';
112
������ | ��֑����� | ����ע1a
113
-----------------+-----------+----------
114
����ԑ�̑��Ա | ���Z01��� |
117
select * from ��Ƒ�㑻������� where ��֑����� like '_Z01_';
118
������ | ��֑����� | ����ע1a
119
-----------------+-----------+----------
120
����ԑ�̑��Ա | ���Z01��� |
123
select * from ��Ƒ�㑻������� where ��֑����� like '_Z%';
124
������ | ��֑����� | ����ע1a
125
-----------------+-----------+----------
126
����ԑ�̑��Ա | ���Z01��� |
129
select * from ��Ƒ�㑻������� where ������ ~ '�����[��ԑͼ]';
130
������ | ��֑����� | ����ע1a
131
-----------------+-----------+----------
132
����ԑ�ԑʾ��� | ���A01��� |
133
����ԑͼ��� | ���B01��� |
136
select * from ��Ƒ�㑻������� where ������ ~* '�����[��ԑͼ]';
137
������ | ��֑����� | ����ע1a
138
-----------------+-----------+----------
139
����ԑ�ԑʾ��� | ���A01��� |
140
����ԑͼ��� | ���B01��� |
143
select *,character_length(������) from ��Ƒ�㑻�������;
144
������ | ��֑����� | ����ע1a | char_length
145
-----------------+-----------+----------+-------------
146
����ԑ�ԑʾ��� | ���A01��� | | 5
147
����ԑͼ��� | ���B01��� | | 4
148
����ԑ�̑��Ա | ���Z01��� | | 5
151
select *,octet_length(������) from ��Ƒ�㑻�������;
152
������ | ��֑����� | ����ע1a | octet_length
153
-----------------+-----------+----------+--------------
154
����ԑ�ԑʾ��� | ���A01��� | | 15
155
����ԑͼ��� | ���B01��� | | 12
156
����ԑ�̑��Ա | ���Z01��� | | 15
159
select *,position('���' in ������) from ��Ƒ�㑻�������;
160
������ | ��֑����� | ����ע1a | strpos
161
-----------------+-----------+----------+--------
162
����ԑ�ԑʾ��� | ���A01��� | | 3
163
����ԑͼ��� | ���B01��� | | 0
164
����ԑ�̑��Ա | ���Z01��� | | 0
167
select *,substring(������ from 3 for 4) from ��Ƒ�㑻�������;
168
������ | ��֑����� | ����ע1a | substr
169
-----------------+-----------+----------+-----------
170
����ԑ�ԑʾ��� | ���A01��� | | ��ԑʾ���
171
����ԑͼ��� | ���B01��� | | �ͼ���
172
����ԑ�̑��Ա | ���Z01��� | | ��̑��Ա
175
drop table �ͪ�ߩ�Ѧ��듾�;
176
ERROR: Relation '�ͪ�ߩ�Ѧ��듾�' does not exist
177
create table �ͪ�ߩ�Ѧ��듾� (��듾� text, ����ړ�� varchar, ����1A�� char(16));
178
create index �ͪ�ߩ�Ѧ��듾�index1 on �ͪ�ߩ�Ѧ��듾� using btree (��듾�);
179
create index �ͪ�ߩ�Ѧ��듾�index2 on �ͪ�ߩ�Ѧ��듾� using hash (����ړ��);
180
insert into �ͪ�ߩ�Ѧ��듾� values('��ēǻ��͓���Ó�����', '�ѦA01�߾');
181
insert into �ͪ�ߩ�Ѧ��듾� values('��ēǻ��͓�ד����ȓ��', '���B10���');
182
insert into �ͪ�ߩ�Ѧ��듾� values('��ēǻ��͓����Γ�ד�����', '���Z01���');
184
select * from �ͪ�ߩ�Ѧ��듾�;
185
��듾� | ����ړ�� | ����1a��
186
--------------------------+--------------+----------------
187
��ēǻ��͓���Ó����� | �ѦA01�߾ |
188
��ēǻ��͓�ד����ȓ�� | ���B10��� |
189
��ēǻ��͓����Γ�ד����� | ���Z01��� |
192
select * from �ͪ�ߩ�Ѧ��듾� where ����ړ�� = '���Z01���';
193
��듾� | ����ړ�� | ����1a��
194
--------------------------+--------------+----------------
195
��ēǻ��͓����Γ�ד����� | ���Z01��� |
198
select * from �ͪ�ߩ�Ѧ��듾� where ����ړ�� ~* '���z01���';
199
��듾� | ����ړ�� | ����1a��
200
--------------------------+--------------+----------------
201
��ēǻ��͓����Γ�ד����� | ���Z01��� |
204
select * from �ͪ�ߩ�Ѧ��듾� where ����ړ�� like '_Z01_';
205
��듾� | ����ړ�� | ����1a��
206
--------------------------+--------------+----------------
207
��ēǻ��͓����Γ�ד����� | ���Z01��� |
210
select * from �ͪ�ߩ�Ѧ��듾� where ����ړ�� like '_Z%';
211
��듾� | ����ړ�� | ����1a��
212
--------------------------+--------------+----------------
213
��ēǻ��͓����Γ�ד����� | ���Z01��� |
216
select * from �ͪ�ߩ�Ѧ��듾� where ��듾� ~ '��ēǻ���[����]';
217
��듾� | ����ړ�� | ����1a��
218
--------------------------+--------------+----------------
219
��ēǻ��͓���Ó����� | �ѦA01�߾ |
220
��ēǻ��͓�ד����ȓ�� | ���B10��� |
223
select * from �ͪ�ߩ�Ѧ��듾� where ��듾� ~* '��ēǻ���[����]';
224
��듾� | ����ړ�� | ����1a��
225
--------------------------+--------------+----------------
226
��ēǻ��͓���Ó����� | �ѦA01�߾ |
227
��ēǻ��͓�ד����ȓ�� | ���B10��� |
230
select *,character_length(��듾�) from �ͪ�ߩ�Ѧ��듾�;
231
��듾� | ����ړ�� | ����1a�� | char_length
232
--------------------------+--------------+----------------+-------------
233
��ēǻ��͓���Ó����� | �ѦA01�߾ | | 8
234
��ēǻ��͓�ד����ȓ�� | ���B10��� | | 7
235
��ēǻ��͓����Γ�ד����� | ���Z01��� | | 8
238
select *,octet_length(��듾�) from �ͪ�ߩ�Ѧ��듾�;
239
��듾� | ����ړ�� | ����1a�� | octet_length
240
--------------------------+--------------+----------------+--------------
241
��ēǻ��͓���Ó����� | �ѦA01�߾ | | 24
242
��ēǻ��͓�ד����ȓ�� | ���B10��� | | 21
243
��ēǻ��͓����Γ�ד����� | ���Z01��� | | 24
246
select *,position('���' in ��듾�) from �ͪ�ߩ�Ѧ��듾�;
247
��듾� | ����ړ�� | ����1a�� | strpos
248
--------------------------+--------------+----------------+--------
249
��ēǻ��͓���Ó����� | �ѦA01�߾ | | 4
250
��ēǻ��͓�ד����ȓ�� | ���B10��� | | 0
251
��ēǻ��͓����Γ�ד����� | ���Z01��� | | 0
254
select *,substring(��듾� from 3 for 4) from �ͪ�ߩ�Ѧ��듾�;
255
��듾� | ����ړ�� | ����1a�� | substr
256
--------------------------+--------------+----------------+--------------
257
��ēǻ��͓���Ó����� | �ѦA01�߾ | | ��͓����
258
��ēǻ��͓�ד����ȓ�� | ���B10��� | | ��͓�ד�����
259
��ēǻ��͓����Γ�ד����� | ���Z01��� | | ��͓����Γ��
263
ERROR: Relation 'test' does not exist
264
create table test (t text);
265
insert into test values('ENGLISH');
266
insert into test values('FRAN��AIS');
267
insert into test values('ESPA��OL');
268
insert into test values('��SLENSKA');
269
insert into test values('ENGLISH FRAN��AIS ESPA��OL ��SLENSKA');
273
--------------------------------------
278
ENGLISH FRAN��AIS ESPA��OL ��SLENSKA
281
select * from test where t = 'ESPA��OL';
287
select * from test where t ~* 'espa��ol';
289
--------------------------------------
291
ENGLISH FRAN��AIS ESPA��OL ��SLENSKA
294
select *,character_length(t) from test;
296
--------------------------------------+-------------
301
ENGLISH FRAN��AIS ESPA��OL ��SLENSKA | 33
304
select *,octet_length(t) from test;
306
--------------------------------------+--------------
311
ENGLISH FRAN��AIS ESPA��OL ��SLENSKA | 36
314
select *,position('L' in t) from test;
316
--------------------------------------+--------
321
ENGLISH FRAN��AIS ESPA��OL ��SLENSKA | 4
324
select *,substring(t from 3 for 4) from test;
326
--------------------------------------+--------
331
ENGLISH FRAN��AIS ESPA��OL ��SLENSKA | GLIS