代码如下,没什么特别的:
SELECT 
   time, 
   IFNULL(table_object_user.name,'已删除用户'), 
   source_ip, dest_ip, local_ip, url, 
   IFNULL(table_site.m_desc,'已删除站点'), 
   IFNULL(GROUP_CONCAT(table_sites_type.name SEPARATOR ','), '已删除站点类型'), 
   m_content, accept 
 INTO OUTFILE 'log__1268668800_1268727414_post.dat' 
  FIELDS TERMINATED BY '\t' OPTIONALLY ENCLOSED BY '\"' 
  LINES TERMINATED BY '\n' 
 FROM table_log_post 
 LEFT JOIN table_object_user ON table_log_post.object_user_id=table_object_user.id 
 LEFT JOIN table_site ON table_log_post.site_id=table_site.id 
  , table_sites_type_urls, table_sites_type 
 WHERE time between 1268668800 AND 1268727414
  AND table_log_post.site_id=table_sites_type_urls.site_id AND table_sites_type_urls.sites_type_id=table_sites_type.id 
 GROUP BY table_log_post.id;