2 create table ¼t°Ó¸ê®Æ (¦æ·~§O text, ¤½¥q©ïÀY varchar, ¦a§} varchar(16));
3 create index ¼t°Ó¸ê®Æindex1 on ¼t°Ó¸ê®Æ using btree (¦æ·~§O);
4 create index ¼t°Ó¸ê®Æindex2 on ¼t°Ó¸ê®Æ using hash (¤½¥q©ïÀY);
5 insert into ¼t°Ó¸ê®Æ values ('¹q¸£·~', '¹F¹F¬ì§Þ', '¥_A01¤¯');
6 insert into ¼t°Ó¸ê®Æ values ('»s³y·~', '°]·½¦³¤½¥q', '¤¤B10¤¤');
7 insert into ¼t°Ó¸ê®Æ values ('À\¶¼·~', '¬ü¨ýªÑ¥÷¦³¤½¥q', '°ªZ01¤E');
9 select * from ¼t°Ó¸ê®Æ;
10 ¦æ·~§O | ¤½¥q©ïÀY | ¦a§}
11 --------+------------------+---------
12 ¹q¸£·~ | ¹F¹F¬ì§Þ | ¥_A01¤¯
13 »s³y·~ | °]·½¦³¤½¥q | ¤¤B10¤¤
14 À\¶¼·~ | ¬ü¨ýªÑ¥÷¦³¤½¥q | °ªZ01¤E
17 select * from ¼t°Ó¸ê®Æ where ¦a§} = '°ªZ01¤E';
18 ¦æ·~§O | ¤½¥q©ïÀY | ¦a§}
19 --------+------------------+---------
20 À\¶¼·~ | ¬ü¨ýªÑ¥÷¦³¤½¥q | °ªZ01¤E
23 select * from ¼t°Ó¸ê®Æ where ¦a§} ~* '°ªz01¤E';
24 ¦æ·~§O | ¤½¥q©ïÀY | ¦a§}
25 --------+------------------+---------
26 À\¶¼·~ | ¬ü¨ýªÑ¥÷¦³¤½¥q | °ªZ01¤E
29 select * from ¼t°Ó¸ê®Æ where ¦a§} like '_Z01_';
30 ¦æ·~§O | ¤½¥q©ïÀY | ¦a§}
31 --------+------------------+---------
32 À\¶¼·~ | ¬ü¨ýªÑ¥÷¦³¤½¥q | °ªZ01¤E
35 select * from ¼t°Ó¸ê®Æ where ¦a§} like '_Z%';
36 ¦æ·~§O | ¤½¥q©ïÀY | ¦a§}
37 --------+------------------+---------
38 À\¶¼·~ | ¬ü¨ýªÑ¥÷¦³¤½¥q | °ªZ01¤E
41 select * from ¼t°Ó¸ê®Æ where ¤½¥q©ïÀY ~ '¹F¹F¬ì[±H°O§Þ]';
42 ¦æ·~§O | ¤½¥q©ïÀY | ¦a§}
43 --------+----------+---------
44 ¹q¸£·~ | ¹F¹F¬ì§Þ | ¥_A01¤¯
47 select * from ¼t°Ó¸ê®Æ where ¤½¥q©ïÀY ~* '¹F¹F¬ì[±H°O§Þ]';
48 ¦æ·~§O | ¤½¥q©ïÀY | ¦a§}
49 --------+----------+---------
50 ¹q¸£·~ | ¹F¹F¬ì§Þ | ¥_A01¤¯
53 select *, character_length(¦æ·~§O) from ¼t°Ó¸ê®Æ;
54 ¦æ·~§O | ¤½¥q©ïÀY | ¦a§} | character_length
55 --------+------------------+---------+------------------
56 ¹q¸£·~ | ¹F¹F¬ì§Þ | ¥_A01¤¯ | 3
57 »s³y·~ | °]·½¦³¤½¥q | ¤¤B10¤¤ | 3
58 À\¶¼·~ | ¬ü¨ýªÑ¥÷¦³¤½¥q | °ªZ01¤E | 3
61 select *, octet_length(¦æ·~§O) from ¼t°Ó¸ê®Æ;
62 ¦æ·~§O | ¤½¥q©ïÀY | ¦a§} | octet_length
63 --------+------------------+---------+--------------
64 ¹q¸£·~ | ¹F¹F¬ì§Þ | ¥_A01¤¯ | 6
65 »s³y·~ | °]·½¦³¤½¥q | ¤¤B10¤¤ | 6
66 À\¶¼·~ | ¬ü¨ýªÑ¥÷¦³¤½¥q | °ªZ01¤E | 6
69 select *, position('¦³' in ¤½¥q©ïÀY) from ¼t°Ó¸ê®Æ;
70 ¦æ·~§O | ¤½¥q©ïÀY | ¦a§} | position
71 --------+------------------+---------+----------
72 ¹q¸£·~ | ¹F¹F¬ì§Þ | ¥_A01¤¯ | 0
73 »s³y·~ | °]·½¦³¤½¥q | ¤¤B10¤¤ | 3
74 À\¶¼·~ | ¬ü¨ýªÑ¥÷¦³¤½¥q | °ªZ01¤E | 5
77 select *, substring(¤½¥q©ïÀY from 3 for 6 ) from ¼t°Ó¸ê®Æ;
78 ¦æ·~§O | ¤½¥q©ïÀY | ¦a§} | substring
79 --------+------------------+---------+--------------
80 ¹q¸£·~ | ¹F¹F¬ì§Þ | ¥_A01¤¯ | ¬ì§Þ
81 »s³y·~ | °]·½¦³¤½¥q | ¤¤B10¤¤ | ¦³¤½¥q
82 À\¶¼·~ | ¬ü¨ýªÑ¥÷¦³¤½¥q | °ªZ01¤E | ªÑ¥÷¦³¤½¥q