title: MYSQL: Tricky Query - need to build intermedia Variable?
body: <p>let´s assume we have the following table</p>
  
  <pre><code>_________________________________________________________________________
  |FlightNo | DepartureDate       | Origin  | Destination | Flightduration |
  _________________________________________________________________________
  | IB233   | 2018-12-31 09:30:45 | Berlin   | Barcelona  | 200            |
  | IB222   | 2019-01-01 12:20:34 | Barcelona| Rome       | 100            |
  | LE111   | 2019-01-01 11:11:11 | Rome     | NY         | 400            |
  __________________________________________________________________________
  </code></pre>
  
  <p>Now I want to calculate the timedifference between the Destination of NY and start in Berlin. <strong>I want to check whether the whole flightduration is &lt; 660 min</strong>.</p>
  
  <p>I worked out this, but it doesn´t work ..</p>
  
  <pre><code>SELECT 
    TIMEDIFF(
      (SELECT adddate(DepartureDate, INTERVAL FlightDuration  
  MINUTE) 
       FROM flightexecution 
       where ICAO_Code_Origin = 'Berlin'), 
      (SELECT DepartureDate 
       FROM flightexecution 
       where ICAO_Code_Destination = 'NY' AND ICAO_Origin NOT LIKE 'Berlin' AND)
  ) from flightexecution ; 
  </code></pre>
  
  <p>MySQL is giving me just an 'OK' as an result, which means that somehting is wrong...</p>
  
  <p>Could you guys help me out?</p>