148 | | COUNT(CASE WHEN p.typeOfPetsID = (SELECT ID FROM proekt.type_of_pets WHERE kind_of_pet = 'Dog') THEN 1 END) AS total_dogs, |
149 | | COUNT(CASE WHEN p.typeOfPetsID = (SELECT ID FROM proekt.type_of_pets WHERE kind_of_pet = 'Cat') THEN 1 END) AS total_cats, |
150 | | AVG(CASE WHEN p.typeOfPetsID = (SELECT ID FROM proekt.type_of_pets WHERE kind_of_pet = 'Dog') THEN EXTRACT(YEAR FROM age(current_date, p.dateOfBirthday)) END) AS avg_age_dogs, |
| 148 | COUNT(CASE WHEN p.typeOfPetsID = (SELECT ID FROM project.type_of_pets WHERE kind_of_pet = 'Dog') THEN 1 END) AS total_dogs, |
| 149 | COUNT(CASE WHEN p.typeOfPetsID = (SELECT ID FROM project.type_of_pets WHERE kind_of_pet = 'Cat') THEN 1 END) AS total_cats, |
| 150 | AVG(CASE WHEN p.typeOfPetsID = (SELECT ID FROM project.type_of_pets WHERE kind_of_pet = 'Dog') THEN EXTRACT(YEAR FROM age(current_date, p.dateOfBirthday)) END) AS avg_age_dogs, |