Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT hp.name AS home, dp.name AS destination, sm.START,
- SQRT(pow(ds.position_x - hs.position_x, 2) +
- pow(ds.position_y - hs.position_y, 2) +
- pow(ds.position_z - hs.position_z, 2)) FROM
- space_missions AS sm
- INNER JOIN planets AS hp ON sm.home_planet_id=hp.id AND sm.START > '2040-01-01'
- LEFT JOIN stars AS hs ON hp.star_id = hs.id
- LEFT JOIN planets AS dp ON sm.dest_planet_id=dp.id
- LEFT JOIN stars AS ds ON dp.star_id = ds.id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement