先
select DATE,prd_no,qty into #temp from t1
union
select DATE,prd_no,qty from t2
union
select DATE,prd_no,qty from t3
然后直接对#temp进行条件筛选。
select DATE,prd_no,qty into #temp from t1
union
select DATE,prd_no,qty from t2
union
select DATE,prd_no,qty from t3
然后直接对#temp进行条件筛选。
union
select DATE,prd_no,qty from t2
union
select DATE,prd_no,qty from t3as t
对t直接进行条件选择
SQL有没有象程序中那样的循环语句?
就象下面
for i=1 to 10
for j=1 to 10
...
next j
next i
要想实现这样的功能该怎么做写?
而用
select DATE,prd_no,qty from t1
union
select DATE,prd_no,qty from t2
union
select DATE,prd_no,qty from t3
生成的表的字段是date,prd_no,qty不一样!?