- 论坛徽章:
- 0
|
回复 #10 sunnyfun 的帖子
想了个一个一个找的方法, 快了很多,
tee /var/tmp/my.list;
select a4.uid,(a4.timestamp-a1.timestamp) from
abclog_entries_20080301 a1,
(select a2.abclog_id, a2.timestamp, a3.uid from
abclog_entries_20080301 a2,
(select abclog_id,uid from
abclogs_20080301 where (box_id=54 or box_id=55 or box_id=56 or box_id=57) and start_type_id=84 and end_type_id=49 and (log_event_ut between unix_timestamp("2008-03-01 05:23:07") and unix_timestamp("2008-03-01 09:30:07"))) a3
where a2.log_type_id=89 and a2.abclog_id=a3.abclog_id) a4
where a1.log_type_id=86 and a1.abclog_id=a4.abclog_id;
+--------------------------------------+-----------------------------+
110214 rows in set (31.57 sec)
对了, 我用tee 把结果输出到一个文件里, 如何告诉MYSQL不要把那写符号(+, -)写出来, 因为我只要数据, 表格对我来说是麻烦. 我要用自己的SCRIPT对数据处理一下, 如果只有数据, 反而容易些. |
|