Limitation of Subsonic Aggregation ("Availability")

I don’t want any way to add a “Having” constraint for aggregation? Example: if I need the entire sales amount by date with a sales amount> 1000.

Regards, TheGodfather

+3
source share
2 answers

SubSonic has a "presence", but you are not explicitly specifying it.

It is determined if you select Aggregate and add an aggregate to the Where clause.

For example (paraphrased from SubSonic AggregateTests.cs)

        SubSonic.SqlQuery q = new
            Select(Aggregate.GroupBy("ProductID"), Aggregate.Avg("UnitPrice"))
            .From("Order Details")
            .Where(Aggregate.Avg("UnitPrice"))
            .IsGreaterThan(50);

In the above SubSonic query, an SQL statement will be created with "HAVING AVG (UnitPrice)> 50"

+5
source

Are you using SubSonic 3.0.0.3 or 2.2?

If you are using 2.2, I do not think you can do this. I am not sure about 3.0.

0
source

Source: https://habr.com/ru/post/1716107/


All Articles