一、输出1-100的数据
此处参考 https://bbs.csdn.net/topics/390516027
with t(id) as ( select 1 as id from sysibm.sysdummy1 a union all select id+1 as id from t,sysibm.sysdummy1 a where id<=100 ) select id from t
二、DB2输出每隔10分钟的数据
WITH TEMP(D_MINUTE) AS ( SELECT TIME('00:00:00') + A MINUTES FROM SYSIBM.SYSDUMMY1 CROSS JOIN (SELECT (ROW_NUMBER()OVER(ORDER BY (VALUES 1)))*10 AS A FROM SYSIBM.SYSDUMMY1,SYSIBM.SYSCOLUMNS FETCH FIRST 144 ROWS ONLY) B ) SELECT * FROM TEMP