select flights.trip_duration as return_in_days from flights as flights
where flights.status = 1  
and flights.departure_city_id = 1010 
and flights.arrival_city_id = 1740
AND flights.return_flight = 1
and flights.status = 1 group by flights.trip_duration order by trip_duration ASC