SELECT
s.row,
JSON_AGG(s.seat_no ORDER BY s.seat_no) AS seats,
s.fare_conditions
FROM
seats s
WHERE
s.aircraft_code = '777-300'
GROUP BY
s.row, s.fare_conditions
ORDER BY
s.row, s.fare_conditions;
;
select * from query_cost('SELECT
s.row,
JSON_AGG(s.seat_no ORDER BY s.seat_no) AS seats,
s.fare_conditions
FROM
seats s
WHERE
s.aircraft_code = ''777-300''
GROUP BY
s.row, s.fare_conditions
ORDER BY
s.row, s.fare_conditions;
');