-
Couldn't load subscription status.
- Fork 3.3k
Labels
Milestone
Description
Similar to PR #19617, we can enable more decimal operations by leveraging UDFs. Unlike TimeSpan, however, there isn't an acceptable type we can convert to to perform the operations, so it will require roughly one UDF per operation. For example:
| Done | .NET | SQL |
|---|---|---|
| ✔ | m1 + m2 | ef_add($m1, $m2) |
| ✔ | m1 / m2 | ef_divide($m1, $m2) |
| ✔ | m1 > m2 | ef_compare($m1, $m2) > 0 |
| ✔ | m1 >= m2 | ef_compare($m1, $m2) >= 0 |
| ✔ | m1 < m2 | ef_compare($m1, $m2) < 0 |
| ✔ | m1 <= m2 | ef_compare($m1, $m2) <= 0 |
| ✔ | m1 % m2 | ef_mod($m1, $m2) |
| ✔ | m1 * m2 | ef_multiply($m1, $m2) |
| ✔ | m1 - m2 | ef_add($m1, ef_negate($m2)) |
| ✔ | -m | ef_negate($m) |
| ✔ | Average(t => t.Decimal) | ef_avg(t.Decimal) |
| ✔ | Max(t => t.Decimal) | ef_max(t.Decimal) |
| ✔ | Min(t => t.Decimal) | ef_min(t.Decimal) |
| ✔ | Sum(t => t.Decimal) | ef_sum(t.Decimal) |
| ✔ | OrderBy(t => t.Decimal) | ORDER BY t.Decimal COLLATE EF_DECIMAL |
| ✔ | OrderByDescending(t => t.Decimal) | ORDER BY t.Decimal COLLATE EF_DECIMAL DESC |
datafile4, Suriman, bricelam, YZahringer, pflannery and 22 more