Fix single key and single column query issue