I am making a function. The select statement returns only one row with one column, for example int. How to save this int inside a declared variable so that my function can return a variable?
select sum(table_name.col1)
from
(select
col1, col2
)table_name
source
share