码迷,mamicode.com
首页 > 数据库 > 详细

sql 随笔更新

时间:2019-02-18 14:33:22      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:%s   mat   sub   date_sub   res   select   xxxx   for   ESS   

SELECT
       DISTINCT(p.`id`), 
       p.`id` ,
       v.`full_name` ,
        CONCAT(LEFT(v.mobile, 7), ‘****‘) ,
       DATE_FORMAT(DATE_ADD(v.`visit_time`, INTERVAL 8 HOUR), ‘%Y-%m-%d %H:%i:%s‘) ,
       v.`remark` ,
       w.`address_city` ,
       v.`record_person` ,
       v.`consult_country` ,
       v.`first_visit` ,
       v.`contact_advisor` ,
       v.`follow_advisor` ,
       v.`assign_person` 
  FROM `aaaa`.`xxxxx` AS v
  LEFT JOIN `bbbb`.`xxxxxxxxxx` AS p ON v.`mobile`= p.`mobile`
  LEFT JOIN  `cccc` AS w ON (w.`full_name` =v.`contact_advisor` or w.`full_name`=v.`follow_advisor` or w.`full_name` =v.`assign_person` )
 WHERE v.`visit_time`>  DATE_FORMAT(DATE_SUB(now(), INTERVAL 24 HOUR), ‘%Y-%m-%d 10:00:00‘)

  

sql 随笔更新

标签:%s   mat   sub   date_sub   res   select   xxxx   for   ESS   

原文地址:https://www.cnblogs.com/niehaidong111/p/10395306.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!