Fix sql generating for table with only one column