Código SQL [-] select A.FECHA, A.HORA, A.GRUPO, A.CODIGO, A.CANTIDAD, B.GRUPO AS CODIGO_MAESTRO from TABLA A inner join TABLA B on B.FECHA = A.FECHA and B.HORA = A.HORA and B.GRUPO = A.GRUPO and B.CANTIDAD = 0
select A.FECHA, A.HORA, A.GRUPO, A.CODIGO, A.CANTIDAD, B.GRUPO AS CODIGO_MAESTRO from TABLA A inner join TABLA B on B.FECHA = A.FECHA and B.HORA = A.HORA and B.GRUPO = A.GRUPO and B.CANTIDAD = 0