I have this query which is concatenated based on conditions in PHP. I am having hard time to convert it in a stored procedure.
$sql = "SELECT cu