TortugaResearch / Tortuga.Chain

A fluent ORM for .NET
Other
335 stars 22 forks source link

Change data types for aggregate columns #483

Open Grauenwolf opened 2 years ago

Grauenwolf commented 2 years ago

Say you have this aggregate.

SELECT AVG([EmployeeKey]) AS [EmployeeKey] FROM [HR].[Employee];

With enough rows, that will overflow an int.

We need an option to emit this instead:

SELECT AVG( CONVERT(real, [EmployeeKey])) AS [EmployeeKey] FROM [HR].[Employee];