wrong SQL-statement repaired