fix reorg sql syntax issue