Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
asadlone
Starting Member
1 Post |
Posted - 2008-06-09 : 05:24:01
|
| Hi all,I need to combine the accumulate result for the below 4 queries in a single query... how can we achieve that.Select count(*) from `TelsisStatistics`.`2008060600Events`;Select count(*) from `TelsisStatistics`.`2008060606Events`;Select count(*) from `TelsisStatistics`.`2008060612Events`;Select count(*) from `TelsisStatistics`.`2008060618Events`;basically its a transformation of 4 queries in to 1 ... while adding the result of all four in the process.thanksBR/Asad |
|
|
soorajtnpki
Posting Yak Master
231 Posts |
Posted - 2008-06-09 : 05:37:20
|
| hi pls try thisi think u want sum of all counts thenselect sum(d.s) from(Select count(*) as s from `TelsisStatistics`.`2008060600Events`union allSelect count(*) as s from `TelsisStatistics`.`2008060606Events`union allSelect count(*) as s from `TelsisStatistics`.`2008060612Events`union allSelect count(*) as s from `TelsisStatistics`.`2008060618Events`)dok tanx... |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-06-09 : 08:00:25
|
The real question is why you need a new table every day and every 6 hours? E 12°55'05.25"N 56°04'39.16" |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-06-09 : 15:49:40
|
quote: Originally posted by asadlone Hi all,I need to combine the accumulate result for the below 4 queries in a single query... how can we achieve that.Select count(*) from `TelsisStatistics`.`2008060600Events`;Select count(*) from `TelsisStatistics`.`2008060606Events`;Select count(*) from `TelsisStatistics`.`2008060612Events`;Select count(*) from `TelsisStatistics`.`2008060618Events`;basically its a transformation of 4 queries in to 1 ... while adding the result of all four in the process.thanksBR/Asad
Are you using MS SQL Server or MySQL?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|