Answers for "sql sum group by"

SQL
0

linq sum group by

var result = source
    .GroupBy(x => x.Currency)
    .Select(g => new {
        Currency = g.Key,
        Total = g.Sum(x => x.FeesCustom > 0 ? x.FeesCustom : x.FeesNormal)
    });
Posted by: Guest on March-12-2020
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