concatenation - Alternative to LIST aggregate function in Firebird -
i have a table orders:
select * orders order 2 ordernumber zone 12345 1 12345 2 12345 3
what sql produce following output?
ordernumber zone 12345 123
unfortunately, list cannot used, since old firebird 1.5xxx. there other possibilities?
create procedure get_zoner(ordernumber integer) returns (zoner varchar(20)) declare variable zone varchar(20) ; begin zoner = ''; select distinct zone orders ordernumber = :ordernumber order zone :zone begin zoner = zoner || :zone; end suspend; end
and use
select * getzoner(1234)
Comments
Post a Comment