Hola Amigos... tengo un problema con esta consulta la cual se me queda pegada. Estoy trabajando en el TOAD.
SELECT DISTINCT a1.polnum,
a1.ScPvaserut,
a1.ScPvasenom,
a1.ScPvASEAPAT,
a1.ScPvaseamat,
a1.ScPvasefnac,
a1.ScPvasedv
FROM altavida.ScPvcarga a1, altavida.scctrcarga a2
WHERE a2.SCGCARTIPO = 1
AND a1.ScPvestreg = 'GE'
AND a1.polnum = a2.polnum
AND a1.scgrpcod = a2.scgrpcod
AND a1.SCGCARFECPRC = a2.SCGCARFECPRC
AND a1.SCGCARSEC = a2.SCGCARSEC
AND (a1.polnum, a1.SCPVASERUT, a1.SCGCARFECPRC) IN
( SELECT x1.polnum,
x1.SCPVASERUT,
MAX (x1.SCGCARFECPRC)
FROM altavida.ScPvcarga x1,
altavida.scctrcarga x2
WHERE x2.SCGCARTIPO = 1
AND x1.ScPvestreg = 'GE'
AND x1.polnum = x2.polnum
AND x1.scgrpcod = x2.scgrpcod
AND x1.SCGCARFECPRC =
x2.SCGCARFECPRC
AND x1.SCGCARSEC = x2.SCGCARSEC
GROUP BY x1.polnum, x1.SCPVASERUT)
GROUP BY a1.polnum,
a1.ScPvaserut,
a1.ScPvasenom,
a1.ScPvASEAPAT,
a1.ScPvaseamat,
a1.ScPvasefnac,
a1.ScPvasedv
alguien me podria ayudar haciendo esta misma consulta con inner join, porque me mareo con tanto atributo jajajajaja.... se agradece