【openGauss/PostgreSQL】openGauss/PostgreSQL随机日期
从日期范围,随机生成日期数据(2万行)
select generate_series(1,20000) as xh
,arr[ceil(random()*17)] as value_date
from (select ARRAY(SELECT generate_series('2024-07-03 00:00:00'::timestamp(0)
, '2024-07-19 00:00:00'::timestamp(0), interval '1 DAY')::timestamp(0)
AS value_date) as arr
);