描述
题解
生成序列表
with recursive t1 as(select 1 as idsunion allselect ids+1 from t1where ids<(select max(customer_id) from Customers))
用序列表与骨科表外连接筛选出剩余的id
select t1.idsfrom t1 left join Customers as a on t1.ids=a.customer_idwhere a.customer_name is null;
写一起
with recursive t1 as(select 1 as idsunion allselect ids+1 from t1where ids<(select max(customer_id) from Customers))select t1.idsfrom t1 left join Customers as a on t1.ids=a.customer_idwhere a.customer_name is null;
