Report question

Question: Convert MS SQL script to Mysql and Oracle