i need to select more values from DB and place it into one field in dataset.
I have method in delphi, which have input parameter TDataSet and exports values from dataset to Excel.
One of field that i want to export is multiple values separated with "," from other table.
I have this tables:
KATALOG
ID_Katalog | atribut_1
----------------------
1 | xxx
KATALOGxPOLOZKA
ID_POLOZKA | ID_KATALOG
-----------------------
1 | 1
2 | 1
3 | 1
I need this result:
ID_Katalog | atribut_1 | polozka
--------------------------------
1 | xxx | 1, 2, 3
Is there any possible way how can i do it please?
I tried subquery, but subquery isnt able to return more than 1 value.
P.S. : Im using - Delphi XE6, ADODB, MS SQL-SERVER.... result must be TDataSet