如果只是三条
select a.*,b.*,c.* from
(
select * from tb where 时间='2004') a,(
select * from tb where 时间='2003') b,(
select * from tb where 时间='2002') c
select a.*,b.*,c.* from
(
select * from tb where 时间='2004') a,(
select * from tb where 时间='2003') b,(
select * from tb where 时间='2002') c
insert into tab
select '2004', '北京', '張三'
union all select '2003', '深圳', '李四'
union all select '2002', '廣州', '陳五'select * from tabdeclare @s varchar(1000)
set @s=''
select @s=@s+時間+' '+地點+' '+人物+' ' from tabprint @s
(
select * from tb where 时间='2004') a,(
select * from tb where 时间='2003') b,(
select * from tb where 时间='2002') c
可以
写的具有通用性!!!
select a.*,b.*,c.* from
(
select * from tb where 时间='2004') a,(
select * from tb where 时间='2003') b,(
select * from tb where 时间='2002') c
可以