Hi All,
I am trying to write an Interbase (Version 6.5) stored procedure (or view) that returns a key field and count followed by comma-separated string derived from a recordset containing multiple rows.
For example, my data is as follows :
Machine Centre Machine Name
C/Lathe Colch2000
C/Lathe HardingeHC3
CNC Mill Cinc2
CNC Mill Cinc3
CNC Mill BlueMat
CNC Mill RedMat
I need the stored procedure to return the following
Machine Centre Count Machine Names Machine Names
C/Lathe 2 Colch2000,HardingeHC3
CNC Mill 4 Cinc2,Cinc3,BlueMat,RedMat
I have tried using FOR SELECT to concatenate the Machine Name field into a string, but have not been able to get it to work.
I would be grateful if anyone has any suggestions.
Many thanks,
MercEng
I am trying to write an Interbase (Version 6.5) stored procedure (or view) that returns a key field and count followed by comma-separated string derived from a recordset containing multiple rows.
For example, my data is as follows :
Machine Centre Machine Name
C/Lathe Colch2000
C/Lathe HardingeHC3
CNC Mill Cinc2
CNC Mill Cinc3
CNC Mill BlueMat
CNC Mill RedMat
I need the stored procedure to return the following
Machine Centre Count Machine Names Machine Names
C/Lathe 2 Colch2000,HardingeHC3
CNC Mill 4 Cinc2,Cinc3,BlueMat,RedMat
I have tried using FOR SELECT to concatenate the Machine Name field into a string, but have not been able to get it to work.
I would be grateful if anyone has any suggestions.
Many thanks,
MercEng