Link to home
Start Free TrialLog in
Avatar of Patrick O'Dea
Patrick O'DeaFlag for Ireland

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.
SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Patrick O'Dea

ASKER

Thanks!
I've got it now!