Fix sql to follow pg style again

Signed-off-by: Arief M Utama <arief.utama@gmail.com>