Changeset 6518
- Timestamp:
- Apr 11, 2008, 2:11:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE/branches/work/toraneko/prj_dbtuning/setup/sql/mysql41/update/update-for2.12-db-tuning.sql
r6508 r6518 22 22 CREATE INDEX `c_member_id_c_diary_id` ON `c_diary_comment_summary`(c_member_id,c_diary_id); 23 23 24 /* 既存データのコンバート */ 25 /* コメント記入履歴時間 */ 26 DROP TABLE IF EXISTS `tmp_c_commu_topic`; 27 CREATE TABLE `tmp_c_commu_topic` ( 28 `c_commu_topic_id` int(11) NOT NULL default '0', 29 `r_datetime_comment` datetime NOT NULL default '0000-00-00 00:00:00', 30 PRIMARY KEY (`c_commu_topic_id`) 31 ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 32 33 INSERT INTO tmp_c_commu_topic (c_commu_topic_id, r_datetime_comment) 34 (SELECT cct.c_commu_topic_id, MAX(cctc.r_datetime) as r_datetime_comment 35 FROM c_commu_topic_comment AS cctc ,c_commu_topic AS cct 36 WHERE cctc.c_commu_topic_id = cct.c_commu_topic_id 37 GROUP BY cct.c_commu_topic_id); 38 39 UPDATE c_commu_topic INNER JOIN tmp_c_commu_topic USING (c_commu_topic_id) 40 SET c_commu_topic.r_datetime_comment = tmp_c_commu_topic.r_datetime_comment; 41 42 DROP TABLE tmp_c_commu_topic; 43
Note: See TracChangeset
for help on using the changeset viewer.