fix sql duplicate columns problem