当有多个表格有同结构数据,查询时可以用联合
[code]SELECT cli, dnis, call_time, talk_dur, charge
FROM (SELECT cli, dnis, call_time, talk_dur, charge
FROM CDR20060904
UNION
SELECT cli, dnis, call_time, talk_dur, charge
FROM CDR20060905) DERIVEDTBL
WHERE (cli = '6010')
ORDER BY call_time[/code]
见临时表
[code]select * into #tmptab from t1[/code]
这样就创建了一个临时表#tmotab,气结构和内容与t1一样
drop table #tmptab--删除