如何把列转行(越简单越好)?
比如:
select max(time) from ....where ...
union
select min(time) from ....where ...
得到
2007-9-1
2007-9-2
希望得到:
2007-9-1 2007-9-2
------解决方案----------------------如果where条件不同,甚至from都不同:
select
(select max(time) from ....where ...),
(select min(time) from ....where ...)
--例如
select
(select max(id) from sysobjects where xtype = 'x '),
(select min(id) from syscolumns where xtype = 175)