Mysql Function Select Into Sql