文章预览
点击上方【蓝色】字体 关注我们 日常饮食应该注意哪些细节?如何提高睡眠质量?哪些坏习惯要尽量避免……随着生活质量的提高,越来越多人开始关注健康的生活方式。今天就和大家分享一些有利于健康的生活好习惯。 01 场景描述 有7个会议室,每个会议室每天都有人开会,某一天的开会时间如下: 查询出开会时间有重叠的是哪几个会议室?上面预期结果是 ID 2 3 4 5 6 02 数据准备 create table meeting as ( select 1 id , '08:00' starttime, '09:15' endtime union all select 2 , '13:20' , '15:20' union all select 3 , '10:00' , '14:00' union all select 4 , '13:55' , '16:25' union all select 5 , '14:00' , '17:45' union all select 6 , '14:05' , '17:45' union all select 7 , '18:05' , '19:45' ) 03 问题分析 方法1:利用 lateral view posexplode()函数将表展开成时间明细表 具体SQL如下: select id , st
………………………………