Answers for "group by sum sql"

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

sql sum and other fields

SELECT sum(a) as car,b,c FROM toys 
GROUP BY b, c
Posted by: Guest on October-25-2020
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