Patrick O'Dea
asked on
Access SQL - Achieving result using only one query
I have a simple table called Animals.
AnimalType , Number_on_Farms
Cat , 1
Dog , 4
Cat, 3
Pig , 5
I want a SQL Query which will show a SINGLE field row output of the total of "Cats" and "Dogs" only.
Output should simply be;
8
My problem is that I find I need to do a second query in order to get a single row output - otherwise I end up with a total for cats and a separate row for dogs. I just want one row output.
AnimalType , Number_on_Farms
Cat , 1
Dog , 4
Cat, 3
Pig , 5
I want a SQL Query which will show a SINGLE field row output of the total of "Cats" and "Dogs" only.
Output should simply be;
8
My problem is that I find I need to do a second query in order to get a single row output - otherwise I end up with a total for cats and a separate row for dogs. I just want one row output.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I've got it now!