Answers for "sql sum groupy by"

SQL
1

sql group by sum with condition

SELECT CityID, 
       COUNT(*) NumberOfDogsInThisCity,
       SUM(CASE WHEN DogName = 'Tedy' THEN Wheight ELSE 0 END) WheightOfAllDogWithNameTedy
FROM Dogs
GROUP BY CityID
Posted by: Guest on July-09-2021
1

sum with group by in sql server

SELECT cust_city, SUM (opening_amt + receive_amt) 
FROM customer 
GROUP BY cust_city;
Posted by: Guest on June-30-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language