How Do I Write a SubSonic Select Statement that Sums Three Columns? -
I have to column SUM 3 and return values in my result. What is the correct way to write it?
SubSonic SQLQuery qs = New Subsonic Choose (). (Table ViewAllatings .Glo.Schema.TableName); SubSonic.Agregate ag = SubSonic.Aggregate.Sum (("Column 1 + Column 2 + Column 3)," Score "); q.Aggregates.Add (AG); String SqlResult = qs.BuildSqlStatement ();
In the form of 'score' in the form of total query likeSUM ("Column1 + Column2 + Column3"), in
SqlResult
SeeBut I also need other fields from my desk.
In that type of query, all the columns in your selection statement need to be the only object, just the total Together, change the type to group instead of group.
SubSonic SQLQuery qs = new selection (new subosonic. Aggregate (new) "column 1 + column 2 + column 3", "score", aggregate function.SUM), // original new subsonic.Agretate (tablename.quel 4, aggregate work Group.), // Another column new subsonic Aggregate (table name column 5, Collected Working GroupBy) // Another column). (Table ViewAllratingsGlo.Schema.TableName);
Comments
Post a Comment