sqlserver4个表查询
我想从a,b,c,d4个表中按时间顺序读出所有记录,这4个表的字段完全相同,sql语句怎么写 --------------------编程问答-------------------- select * from aunion all
select * from b
union all
select * from c
union all
select * from d
order by datefileld
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)
最新版本:20070212
http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html --------------------编程问答-------------------- 被抢了。
最好做个视图,视图的建立用楼上的sql,查询视图要比这个直接union的sql快些 --------------------编程问答-------------------- 先把四个表融合到一个表中,然后再排序!
用临时表也行,用视图也行! --------------------编程问答-------------------- select * from
(
select * from a
union all
select * from b
union all
select * from c
union all
select * from d
) t
order by 时间
把这个最好整成视图
补充:.NET技术 , ASP.NET