On 25-Jun-2003 Mike Morton wrote:
> I have searched the archives and the docs - and I cannot seem to find or
> adapt an answer to this particular problem, hopefully someone out there
> either knows how or can say simply that it cannot be done.
> 
> I have two tables that have the exact same schema, orders and old_orders:
> 

<snip>

> I want to get a count of the 2 tables combined where the member id is a
> specific number.  I.e. Something like:
> 

<snip>

> 
> Is it possible to do what I am asking?  If so could someone point me in
> the
> right direction?

Look for 'UNION' and 'MERGE' in the manual.

If you're pre 4.0 then:

SET @cnt:=SELECT COUNT(*) FROM orders WHERE member_id='2';
SELECT @cnt + COUNT(*) AS totcnt FROM old_orders WHERE member_id='2';

Regards,
-- 
Don Read                                     [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
                            (53kr33t w0rdz: sql table query)


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to