Solving the problem "ambiguous column name" in SQL-Queries