I have this queury:
SELECT A, B, C
FROM ( SELECT
lla.id as A,
max(decode(lla.attrid, 2, lla.valstr, null)) as B,
max(decode(lla.attrid, 3, lla.valstr, null)) as C
FROM
llattrdata lla,
llattrdata lla2
WHERE
lla.id = lla2.id
GROUP BY lla.id)
WHERE C = "Yes"
Is there a better way to do this? I tried to use a HAVING clause, but couldn't get it to work against column C="Yes". Thanks in advance.