SqlKata - Dynamic Sql query builder for dotnet | Product Hunt

🎉 SqlKata is now on Product Hunt

Please upvote to support the product development

Grouping

GroupBy

//:playground
var query = new Query("Comments")
                .Select("PostId")
                .SelectRaw("count(1) as count")
                .GroupBy("PostId");
SELECT [PostId], count(1) as count FROM [Comments] GROUP BY [PostId]

GroupByRaw

//:playground
var query = new Query("Companies")
    .Select("Profit")
    .SelectRaw("COUNT(*) as count")
    .GroupByRaw("Profit WITH ROLLUP");

In PostgreSql

SELECT "Profit", COUNT(*) as count FROM "Companies" GROUP BY Profit WITH ROLLUP
Heap apparel

THE APPAREL BRAND FOR DEVELOPERS

one email per month about tips & tricks, new features, and maybe community feedback