点击蓝色字关注“SQL数据库运维”,回复“SQL”获取2TB学习资源!
DO $$ DECLARE
diff INTERVAL;
BEGIN RAISE NOTICE '2025新年倒计时开始:';
LOOP diff = age(timestamp '2025-01-01 00:00:00+0800', clock_timestamp());
IF diff <= interval '0' THEN
EXIT;
END IF;
RAISE NOTICE '%天 %时 %分 %秒', extract(day from diff),
extract(hour from diff),
extract(minute from diff),
round(extract(second from diff));
PERFORM pg_sleep(1);
END LOOP;
RAISE NOTICE '2025新年好!';
EXCEPTION
WHEN OTHERS THEN RAISE;
END;
$$;
点击关注“SQL数据库运维”,后台或浏览至公众号文章底部点击“发消息”回复关键字:进群,带你进入高手如云的技术交流群。后台回复关键字:SQL,获取学习资料。
动动小手点击加关注呦☟☟☟