??MySQL?л?????????????
???????????? ???????[ 2012/11/13 11:45:42 ] ????????
?????????????ó????????????????????????????????????????????????????????λ????????????????Щ????????????SELECT????е?LIKE??????????????????????????????У????????????????????????Ч???????μ??????????????????????????
????MySQL????????????????????????????????????????????????????????????????????????????Σ????????????MySQL????????Щ?????????????????????????????Ч??????MySQL????Щ???????????????????????????????????????????????????MySQL?????????????????????????????????????????
??????????????????????MySQL????ν????????????
????????????????????????μ?SQL????
mysql> CREATE TABLE reviews (id INT(5) PRIMARY KEY NOT NULL AUTO_INCREMENT?? data TEXT);
???????????????????????????????????????????ε?????????????????????????Щ?????
mysql> INSERT INTO `reviews` (`id`?? `data`) VALUES(1?? 'Gingerboy has a new single out called Throwing Rocks. It's great!');
mysql> INSERT INTO `reviews` (`id`?? `data`) VALUES (2?? 'Hello all?? I really like the new Madonna single. One of the hottest tracks currently playing...I've been listening to it all day');
mysql> INSERT INTO `reviews` (`id`?? `data`)VALUES (3?? 'Have you heard the new band Hotter Than Hell?They have five members and they burn their instruments when they play in concerts. These guys totally rock! Like?? awesome?? dude!');
??????????????????
mysql> SELECT * FROM reviews;
+----+--------------------------------------------+
id data
+----+--------------------------------------------+
1 Gingerboy has a new single out called ...
2 Hello all?? I really like the new Madon ...
3 Have you heard the new band Hotter Than...
+----+--------------------------------------------+
3 rows in set (0.00 sec)
??????????????????????????????????????
mysql> ALTER TABLE reviews ADD FULLTEXT INDEX (data);
Query OK?? 3 rows affected (0.21 sec)
Records: 3 Duplicates: 0 Warnings: 0
???????SHOW INDEXES????????????????????????
mysql> SHOW INDEXES FROM reviews;
+---------+---------------+--------+------+------------+---------+
Table Column_name Packed Null Index_type Comment
----------+---------------+--------+------+------------+---------+
reviews id NULL BTREE
reviews data NULL YES FULLTEXT
+---------+---------------+--------+------+------------+---------+
???????????????????????????????MySQL???????????????????????????????MATCH...AGAINST????SELECT???????????????????????????????????е???“single”??????
mysql> SELECT id FROM reviews WHERE MATCH (data) AGAINST ('single');
+----+id +----+
1
2
+----+
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11