Friends I have the following table called Scheduling_delivery with the following fields
cod_entrega, cod_ordenamiento, cod_centro_atencion, cod_medicamento
I need to find when there is only duplicate data on the medication. for example
entrega 1, ordenamiento 1289, centroAtencion 12345, cod_medicamento 5
entrega 1, ordenamiento 1289, centroAtencion 12345, cod_medicamento 6
Usually they are like that, where the medication is different, but I need to locate only those that have the same order.
I'm trying to do it like that
SELECT ENTRE.COD_ORDENAMIENTO, ENTRE.COD_CENTRO_ATENCION, ENTRE.COD_ENTREGA, ENTRE.COD_MEDICAMENTO,
ENTRE2.COD_ORDENAMIENTO, ENTRE2.COD_CENTRO_ATENCION, ENTRE2.COD_ENTREGA, ENTRE2.COD_MEDICAMENTO
FROM IPS_PROGRAMACION_ENTREGAS@CONSUBAS ENTRE,
IPS_PROGRAMACION_ENTREGAS@CONSUBAS ENTRE2
WHERE ENTRE.COD_ORDENAMIENTO = ENTRE2.COD_ORDENAMIENTO AND
ENTRE.COD_CENTRO_ATENCION = ENTRE2.COD_CENTRO_ATENCION
AND ENTRE.COD_ENTREGA = ENTRE2.COD_ENTREGA
AND ENTRE.COD_MEDICAMENTO = ENTRE2.COD_MEDICAMENTO;
But it brings me only the repeated data from the same query.