Converted first script from MS SQL to MySQL