Hi there,
The following statement produces multiple results, but I only need one.
SELECT CREDITOR_NAME, CREDITOR_NO, INV_ID, TRAIN_COUNT, COUNT(CREDITOR_NO) as number_of_inv
FROM DIPPMX.ADMIN.TI$ST_RECO
GROUP BY CREDITOR_NAME, INV_ID, TRAIN_COUNT, CREDITOR_NO
HAVING COUNT(CREDITOR_NO) >= 5
Normally I would include the CREDITOR_NAME in MIN(), but this wont work due to the COUNT(CREDITOR_NO). Any help is appreciated.
Thanks in advance,
Alain