fixed issues with sql in vertica