How can I generate something like an array from a select? , we are not allowed to create procedures or functions in the database.
I expose the problem.
$Query = "select to_char(ld.diario_id) diario_id,COLABORADOR_ID from XXQP.XXQP_DIARIO_LN_TBL ld inner join XXQP.XXQP_DIARIO_HD_TBL d on ld.diario_id=d.diario_id
WHERE 1 = 1 AND ld.ESTATUS=11 and ld.remesa_id is not null
and d.fecha_cierre_diario >= to_date('2016-12-05 00:00:00','yyyy-mm-dd HH24:MI:SS')
and d.fecha_cierre_diario <= to_date('2016-12-05 23:59:00','yyyy-mm-dd HH24:MI:SS')
and d.plaza_id = '37'
GROUP BY D.COLABORADOR_ID,ld.diario_id ORDER BY D.COLABORADOR_ID DESC;
This query throws me the information row by row.
DIARIO_ID COLABORADOR_ID
27683 111250
28177 111250
28178 110493
28149 109260
27830 108978
27863 108978
27465 108698
27389 108698
What I'm looking for is that I generate it:
DIARIO_ID COLABORADOR_ID
27683,28177 111250
28178 110493
28149 109260
27830,27863 108978
27465,27389 108698
So that I send something similar to an "array" and process it in turn in a second query.
I'm waiting for comments.
For your attention.
Thank you.