How can I convert my SQL code into a proper stored procedure with the correct syntax

visit shbcf.ru