【发布时间】:2015-08-23 23:05:12
【问题描述】:
除了使用不同年份的数据外,我必须使用相同的命令创建多个表。例如:
create temp table test_2002 as
select *
from claim
where purchase_year = '2002';
create temp table test_2003 as
select *
from claim
where purchase_year = '2003';
.....
我想创建10个表,比如test_2002、test2003、test2004等。但是我不想重复写10次。那么有没有办法简化这个过程,比如写一个宏?
提前致谢!
【问题讨论】: