全部评论
如果每个uid在昨天都只发起了一个对话的话,那就是: with firstsent as (select uid,min(ts) 'senttime' from tbl_msgs where direction=0 group by uid), firstrespond as (select csid,uid,min(ts) 'respondtime' from tbl_msgs where direction=1 group by csid,uid), tmp as (select csid,respondtime-senttime 'timediff' from firstsent p1 left join firstrespond p2 on p1.uid=p2.uid) select csid,avg(timediff) 'averagetime' from tmp group by csid;
什么岗啊
相关推荐
点赞 评论 收藏
分享
10-10 16:56
武汉工程大学 嵌入式工程师 点赞 评论 收藏
分享
只会一面挂:这种离谱的部门,不去也罢
点赞 评论 收藏
分享
点赞 评论 收藏
分享
