Super26
asked on
Getting the count of multiple tables with one SQL statement
Is there any way we can get the total count of multiple tables with one sql statement? Something like this:
Select count(Video_ID) As VideoCount, count(Customer_ID) As CustomerCount from Video, Customer
Obviously this doesn't work, I was wondering if there was any correct way of doing this. I would appreciate any help. Thanks.
Select count(Video_ID) As VideoCount, count(Customer_ID) As CustomerCount from Video, Customer
Obviously this doesn't work, I was wondering if there was any correct way of doing this. I would appreciate any help. Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks so much TextReport. I used the second example you gave me. You've saved me hours worth of work, once again, thanks!
Select 'VideoCount', Count(*) As Quantity FROM VideoCount
UNION
Select 'CustCount', Count(*) As Quantity FROM Customer
Cheers, Andrew