I am trying to do a basic query that calculates average, min, max, and count.
SELECT
MIN(column) as min,
MAX(column) as max,
AVG(column) as avg,
count(*) as count
FROM database.dbo.table;
Where column is of type int, and the database is azure sql standard.
and in return, i get an error: "Arithmetic overflow error converting expression to data type int"
Why is int getting a casting-to-int problem in the first place? and is there something I can add that will make this work on all numerical types?