How to sum a BIGINT column #4000
-
I am trying to do a |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There is no fundamental difference between summing a Otherwise you need to provide a minimal example, including the complete error message you get from rustc if you need further help. |
Beta Was this translation helpful? Give feedback.
-
This is what I was doing let sum: Option<i64> = my_table::table
.select(diesel::dsl::sum(my_table::big_int_col))
.first(conn)?; and I get this:
|
Beta Was this translation helpful? Give feedback.
Well as already written above: You need to use a rust side type that is compatible with the
Numeric
sql type. That's not the case fori64
so that's expected behavior. See the documentation for a list of compatible types.