zoukankan      html  css  js  c++  java
  • mysql timestamp

     select from_unixtime(m.createdAt, '%Y-%m-%d %H:%i:%s') from kfrobotaidlog m;

    select m.customeruid, from_unixtime(m.createtime, '%Y-%m-%d %H:%i:%s') as `date-time`, m.kfuid,
    case when m.kfuid = 1001 then '自动回答' when type = 2  then '人工回答'  else '客户问题' end as `问答`, 
    m.content as `内容` from kfmessage m
    join (select distinct customeruid from kfmessage where kfuid = 1001 
    and 

    createtime >=  
    UNIX_TIMESTAMP(STR_TO_DATE('2019-01-20 00:00:00', '%Y-%m-%d %H:%i:%s')) AND 
    UNIX_TIMESTAMP(STR_TO_DATE('2019-01-20 07:00:00', '%Y-%m-%d %H:%i:%s'))) 

    m2 on m.customeruid = m2.customeruid
    where 
    m.createtime > UNIX_TIMESTAMP(STR_TO_DATE('2019-01-20 00:00:00', '%Y-%m-%d %H:%i:%s')) 
    and 
    m.createtime < UNIX_TIMESTAMP(STR_TO_DATE('2019-01-20 10:00:00', '%Y-%m-%d %H:%i:%s')) 
    and
    m.kfuid <> 1002
    order by m.customeruid, id 
     
    =======================波哥查询=========================
    查看customeruid
    select m.customeruid, m.content, a.clientQuestion, a.answer from kfrobotaidlog a join kfmessage m on a.messageId = m.id group by m.customeruid
     
    =================
    分析智能客服对话
     select from_unixtime(m.createdAt, '%Y-%m-%d %H:%i:%s') from kfrobotaidlog m;

    select m.customeruid, from_unixtime(m.createtime, '%Y-%m-%d %H:%i:%s') as `date-time`, m.kfuid,
    case when m.kfuid = 1001 then '自动回答' when type = 2  then '人工回答'  else '客户问题' end as `问答`, 
    m.content as `内容` from kfmessage m
    join (select distinct customeruid from kfmessage where kfuid = 1001 
    and 

    createtime >=  
    UNIX_TIMESTAMP(STR_TO_DATE('2019-01-20 00:00:00', '%Y-%m-%d %H:%i:%s')) AND 
    UNIX_TIMESTAMP(STR_TO_DATE('2019-01-20 07:00:00', '%Y-%m-%d %H:%i:%s'))) 

    m2 on m.customeruid = m2.customeruid
    where 
    m.createtime > UNIX_TIMESTAMP(STR_TO_DATE('2019-01-20 00:00:00', '%Y-%m-%d %H:%i:%s')) 
    and 
    m.createtime < UNIX_TIMESTAMP(STR_TO_DATE('2019-01-20 10:00:00', '%Y-%m-%d %H:%i:%s')) 
    and
    m.kfuid <> 1002
    order by m.customeruid, id 
     ====================
    查找某一天接入的人的数量

    select * from
    (select m.customeruid, m.content, a.clientQuestion, a.answer,a.questionUid,from_unixtime(a.createdAt, '%Y-%m-%d %H:%i:%s') as createtime from kfrobotaidlog a join kfmessage m on a.messageId = m.id ) t
    where createtime> '2019-01-31 00:17:09' and createtime< '2019-02-01 00:17:09'

  • 相关阅读:
    PHP学习笔记:APACHE配置虚拟目录、一个站点使用多域名配置方式
    转载:分页原理+分页代码+分页类制作
    PHP学习笔记:数据库学习心得
    PHP学习笔记:用mysqli连接数据库
    PHP学习笔记:MySQL数据库的操纵
    PHP学习笔记:利用时间和mt_rand函数获取随机名字
    PHP学习笔记:等比例缩放图片
    前端学习(一) html介绍和head标签
    Python 协程
    Python 线程----线程方法,线程事件,线程队列,线程池,GIL锁,协程,Greenlet
  • 原文地址:https://www.cnblogs.com/yjybupt/p/10337996.html
Copyright © 2011-2022 走看看