Split sql into two statements.

My fix issue on some versions of MySQL.