美文网首页
【MySQL】case when用习惯了,别把between a

【MySQL】case when用习惯了,别把between a

作者: 南方者 | 来源:发表于2020-04-16 07:37 被阅读0次

MySQL语句 between and 学习

查的A表,需要关联求和B表里的id,

条件是B的timeB在A表time的区间createTime和updateTime内。

一个sql语句如何写?

select sum(b.timeB) from A a left join B b on b.timeB between a.createTime and a.updateTime

有其他sql语句需求的可以直接评论询问,笔者会帮你思考思考,尽之所能,如有其他存在问题,也请各路山居隐士指点一二。

相关文章

网友评论

      本文标题:【MySQL】case when用习惯了,别把between a

      本文链接:https://www.haomeiwen.com/subject/aalxvhtx.html