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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Count(*)

Author  Topic 

pravin14u
Posting Yak Master

246 Posts

Posted - 2008-04-15 : 07:59:10
How to I calculate the sum on count(*) from multiple tables?

Prakash.P
The secret to creativity is knowing how to hide your sources!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-15 : 08:01:38
SELECT SUM(theCount)
FROM (
SELECT COUNT(*) AS theCount FROM Table1
UNION ALL
SELECT COUNT(*) FROM Table2
UNION ALL
SELECT COUNT(*) FROM Table3
) AS d



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -