Fix some SQL Problem