我有三个这样的查询:
select avg( datediff(mi,t.dtime, t.PAICdate )) as Avgparkingtime
from (
select top 10 * from transaction_tbl where locid=6 order by transactID desc
) t
select avg( datediff(mi,t.Paydate, t.DelDate )) as AvgDelivarytime
from (
select top 10 * from transaction_tbl where locid=6 order by transactID desc
) t
select avg( datediff(mi,t.dtime, t.DelDate )) as Avgstaytime
from (
select top 10 * from transaction_tbl where locid=6 order by transactID desc
) t
我这样出去了:
Avgparkingtime
--------------
23
AvgDelivarytime
---------------
38
Avgstaytime
-----------
39
我怎么能加入这三个quires ..我想把这三个结果连成一行.. 我的期望是这样的:
Avgparkingtime AvgDelivarytime Avgstaytime
-------------- -------------- ------------
23 38 39
我怎么能做到这一点?