2021-03-28から1日間の記事一覧

SQL で範囲が記録されたテーブルから任意の範囲が隙間なくすべて埋まっているか得る

次のようなテーブルがあったとします。1 レコードが a~b の範囲を示しています。終端の端点は含みません。例えば 3~6 なら 3,4,5 を含む範囲です。 create table t ( id int not null primary key auto_increment, a int not null, b int not null ); inse…