1

Topic: Question for choice the data

Good afternoon. Firebird 2.5
I do sampling under tables

SELECT c.name, a. PZ_ZAKAZ, b.d_start,
(a.pz_zakaz || ' - ' || ' (' || a.pz_s || ') ') opis
FROM PLAN$ZAKAZ a, ANALIZ$ZAKAZ b, LABEL$TOCHKA c
WHERE a.pz_zakaz=b.analizzakaz
AND b.tochka=c.t_unit
ORDER BY a. PZ_ZAKAZ, b.tochka, b.d_start

All are normally deduced the data. But I will not understand as to group the data namely it is necessary to receive

NAME OPIS D_Start
---------------------------------------------
|1 | Zakaz1, Zakaz2. | 2/3/2018 |
|2 | Zakaz3, Zakaz2. | 2/3/2018 |
|4 | Zakaz1, Zakaz2. | 2/3/2018 |
----------------------------------------------

2

Re: Question for choice the data

As about following request

SELECT C.NAME
, LIST (A.PZ_ZAKAZ, ', ') AS OPIS
, MIN (B.D_START) AS D_START
FROM PLAN$ZAKAZ A, ANALIZ$ZAKAZ B, LABEL$TOCHKA A C
WHERE A.PZ_ZAKAZ = B.ANALIZZAKAZ
AND B.TOCHKA = C.T_UNIT
GROUP BY 1
ORDER BY 1