SQL:
create TEMPORARY table A select count(1) as C from TABLE1; insert into A select count(1) as C from TABLE2; ..... select sum(C) from a; drop table A;
Or create TEMPORARY table A (C integer); insert into A select count(1) from TABLE1 union all select count(1) from TABLE2 ....... union all select count(1) from TABLEn;
select sum(C) as count from A; drop table A;
Santino
At 6:54 -0400 14-10-2004, Michael J. Pawlowsky wrote:
Does anyone know of a quick way to get the number of rows in a database from the command prompt.
I run a cron job that does a mysql dump nightly from a prod server piped to a standy server.
It's a 2 line shell script including outputting the date at time.
After the dump, I would like to output the number of rows in the prod database and the newly updated standby database to make sure these match. The output is e-mailed to me, so in the morning I could simply see if they match and be assured that the dump went well.
Thanks, Mike
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]