Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
SELECT CAST(SUBSTRING(s.seat_no FROM '^[0-9]+') AS INTEGER) AS row, -- Извлекаем номер ряда (число) JSON_AGG(s.seat_no ORDER BY s.seat_no) AS seats, -- Собираем места в ряду в JSON s.fare_conditions -- Тип места (класс) FROM seats s WHERE s.aircraft_code = '777-300' -- Для самолета Boeing 777-300 GROUP BY row, s.fare_conditions -- Группировка по ряду и классу ORDER BY row, s.fare_conditions; -- Сортировка по ряду и классу ; select * from query_cost('SELECT CAST(SUBSTRING(s.seat_no FROM ''^[0-9]+'') AS INTEGER) AS row, -- Извлекаем номер ряда (число) JSON_AGG(s.seat_no ORDER BY s.seat_no) AS seats, -- Собираем места в ряду в JSON s.fare_conditions -- Тип места (класс) FROM seats s WHERE s.aircraft_code = ''777-300'' -- Для самолета Boeing 777-300 GROUP BY row, s.fare_conditions -- Группировка по ряду и классу ORDER BY row, s.fare_conditions; -- Сортировка по ряду и классу ');

Stuck with a problem? Got Error? Ask AI support!

Copy Clear