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'