Python Array Replace Function In Sql