AlHal2
asked on
Row Count of Multiple tables in single table
I have a database with several tables and I want to find out how many rows are added each day.
Each table has a field MaintDate which is the date the row was added. Therefore the query below would give what I want for Table1.
select maintdate,count(maintdate) As NumberofUpdates from Table1 where maintdate >20071001 group by maintdate
There are many tables and I want the output in tabular format e.g
Date Table1Updates, Table2Updates
01/01/07 78,65
02/01/07 555,666
03/01/07 100,200
Each table has a field MaintDate which is the date the row was added. Therefore the query below would give what I want for Table1.
select maintdate,count(maintdate)
There are many tables and I want the output in tabular format e.g
Date Table1Updates, Table2Updates
01/01/07 78,65
02/01/07 555,666
03/01/07 100,200
ASKER
Then I won't get the table heading going across. I'll just have one long column of results.
ASKER
Please let me know if I've not been clear.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Select maintdate,count(maintdate)
UNION
Select maintdate, NULL As Table1, count(maintdate) As NumberofUpdates As Table2 from Table1 where maintdate >20071001 group by maintdate
and so on....you can add more statements and note the number of columsn for tables you use.