Revert "Revert "correct sql""

This reverts commit c07d96dd2966c845e0d76ed1a569390de9a52785.