Subject Re: [firebird-support] Multiple LIST columns
Author Daniel Miller
I found a far more elegant? way to accomplish this - concatenate the fields with a single LIST, e.g.

select n.NODE, h.ROUTE_UPDATED,
    list( h.ROUTE_INDEX || h.LINK_NODE || h.QUALITY )
from NODES n
join ROUTE_HISTORY h on n.NODE=h.NODE
where n.NODE=5104
group by n.NODE, h.ROUTE_UPDATED
order by h.ROUTE_UPDATED desc

This ensures the "lists" are matching - but brings up another problem which I'll start another thread on.
--
Daniel

On 9/27/2017 10:26:31 PM, "'Daniel Miller' dmiller@... [firebird-support]" <firebird-support@yahoogroups.com> wrote:

With a statement such as:

select n.NODE, h.ROUTE_UPDATED,
    list( h.ROUTE_INDEX ) LI, list( h.LINK_NODE ) LN, list( h.QUALITY ) LQ
from NODES n
join ROUTE_HISTORY h on n.NODE=h.NODE
where n.NODE=5104
group by n.NODE, h.ROUTE_UPDATED
order by h.ROUTE_UPDATED desc

Are the LISTS guaranteed to be in matching order? So each entry of each comma-delimited list is pulled from the same row as the corresponding entry in the other lists?

--
Daniel