原标题:SQL 难点解决:序列生成
1、 生成连续整数序列
MySQL8: with recursive t(n) as (
select 1
union all
select n+1 from t where n<7
)
select * from t;
Oracle:select level n
from dual connect by level<=7;
集算器 SPL:
A1:构造从 1 到 7 的整数序列
示例 1:百鸡问题,鸡翁一值钱五,鸡母一值钱三,鸡雏三值钱一。百钱买百鸡,问鸡翁、母、雏各几
MySQL8:
with recursive jg(n) as (select 1 union all select n+1 from jg where n<100/5),
jm(n) as (select 1 union all select n+1 from jm where n<100/3),