I have a function named get_open_profit that calculated some data.
input of this function does not work properly.
I have a table named results that if we querying on it the result is :
select sum_buy_trades from results order by sum_buy_trades limit 1 : 274
select total_avg_buy from results order by sum_buy_trades limit 1 : 2019746
when I write function like this
select get_open_profit(274, 2019746) result is : 30192700
But if write like this I got error
select get_open_profit(select sum_buy_trades from results order by sum_buy_trades limit 1, select total_avg_buy from results order by sum_buy_trades limit 1
why it does not worked?