[PLAT-3703] Fix bug in sql syntax