shlogg · Early preview
Judy @esproc_spl

List Flight Connections By Group With SPL Code

List flight connections for each group. Use SPL code to split ROUTE field by dash, remove duplicates & concatenate.

The data table in MSSQL database stores flight connections. ID field is the group of connected flights. ROUTE field is the flight connection; the value consists of a pair of connected flights concatenated by a short dash. LNO field is the serial order of each pair of connected flights.

Task: List the complete sequence of connections for each flight group (still use the short dash to connect flights) and arrange the sequences by flight group. Below is the expected result:

Write the following SPL code:

A1: Run the simple SQL; and pay attention to the data order.
A2: Group rows by ID and handl...