title: Ambiguous field name between an alias and a field in the select list with name
body: <p>I have a SQL query to link many tables using the word "using" and one of the tables occurs in each element, error:</p>
  
  <blockquote>
    <p>Ambiguous field name between an alias and a field in the select list with the name. ID_DEPARTMENT</p>
  </blockquote>
  
  <p>how to change the query correctly? Request link: <a href="https://pastebin.com/t2rqMAut" rel="nofollow noreferrer">https://pastebin.com/t2rqMAut</a></p>
  
  <pre><code>select id_teacher, fio, post, teachersanddepartments.id_department, 
         name_of_department, id_subject, name_of_subject, specific, 
         subjects.id_department, name_of_department,
         id_classroom, number_of_classroom, specific, 
         classrooms.id_department, name_of_department, id_group, 
         name_of_group, groups.id_department, name_of_department,
         specifics, daytime, pair, NUMERATOR_DENOMINATOR, keyy, typekey
  from ((((classes join teachers using(id_teacher) join teachersanddepartments 
  
  using(id_teacher) join departments using(id_department))
  join subjects using (id_subject) join departments using(id_department))
  join classrooms using(id_classroom) join departments using(id_department))
  join groups using (id_group) join departments using(id_department))
  </code></pre>
  
  <p>this is a query to initialize the schedule items, each item belongs to its own Department, so i need to add the departments table every time. 
  Database schema: <a href="https://i.stack.imgur.com/LKsGr.png" rel="nofollow noreferrer">Database schema</a></p>
  
  <p>I attach the database file <a href="https://drive.google.com/open?id=1xMdj7TurtoClrpt_BB6LMj1RCyf2A2-W" rel="nofollow noreferrer">example</a>
  current version of Firebird: 2.5.7</p>