LardaX

04_update_tickets

Jun 20th, 2017
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.23 KB | None | 0 0
  1. UPDATE `tickets` AS t
  2. INNER JOIN `flights` AS f
  3. ON t.flight_id = f.flight_id
  4. SET `price` = `price` * 1.2
  5. WHERE f.flight_id =
  6.     (SELECT a.airline_id
  7.     FROM `airlines` AS a
  8.     GROUP BY a.airline_id
  9.     HAVING MAX(a.rating)
  10.     LIMIT 1);
Advertisement
Add Comment
Please, Sign In to add comment