create procedure dist_profit_pairs1(IN user_id varchar(20),IN plan varchar(20)) begin DECLARE left_bvs,right_bvs Float DEFAULT 0; SELECT sum(businessvalues)as left_bvs from bv_history where userid=user_id and type='Distribution Profit' and position='Left'; SELECT sum(businessvalues)as right_bvs from bv_history where userid=user_id and type='Distribution Profit' and position='Right'; IF left_bvs < right_bvs THEN SELECT left_bvs; ELSE SELECT right_bvs;
SELECT left_bvs;
RETURN
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)