title: SQL select all from one table of joint tables
body: <p>I am a SQL beginner and I need to figure out this query: I have three tables joined together from which I am counting certain value, like this:</p>
  
  <pre><code>SELECT SEATS_MAX-COUNT(BOOKING_ID) 
  FROM FLIGHTS 
    INNER JOIN PLANES ON FLIGHTS.PLANE_ID=PLANES.PLANE_ID 
    LEFT JOIN BOOKINGS ON FLIGHTS.FLIGHT_ID=BOOKINGS.FLIGHT_ID 
  GROUP BY SEATS_MAX;
  </code></pre>
  
  <p>This returns number of free seats in a flight. But I would like to get all the columns from FLIGHTS (as in <code>SELECT * FROM FLIGHTS;</code>) plus the count number. i.e. something like</p>
  
  <pre><code>SELECT FLIGHTS.*, SEATS_MAX-COUNT(BOOKING_ID) 
  FROM FLIGHTS 
    INNER JOIN PLANES ON FLIGHTS.PLANE_ID=PLANES.PLANE_ID 
    LEFT JOIN BOOKINGS ON FLIGHTS.FLIGHT_ID=BOOKINGS.FLIGHT_ID 
  GROUP BY SEATS_MAX;
  </code></pre>
  
  <p>but this doesn't work (invalid user.table.column, table.column or column specification). Is there a way to achieve this? I'm using Oracle db.</p>
  
  <p>Thanks</p>