Subject BLR Error
Author Raigo
I am getting "BLR Error" on following query, what might be wrong?

SELECT distinct
Pere.FKOOD,
Pere.PKOOD,
Pere.PFKOOD,
Pere.PNIMI,
(select first 1 pildiid from perepilt where perepilt.fkood=pere.fkood
and perepilt.pfkood=pere.pfkood and perepilt.pkood=pere.pkood) PILDIID
FROM ART Art
INNER JOIN PERE Pere
ON (Pere.PFKOOD= Art.PFKOOD)
AND (Pere.FKOOD= Art.FKOOD)
AND (Pere.PKOOD= Art.PKOOD)
WHERE
Pere.FKOOD='TEST' AND
Pere.PFKOOD='WM' AND
Pere.WEB = 'T' AND

Art.WEB = 'T' AND
Art.Myygihind >0 AND
Pere.PFKOOD<>'SM' AND
Pere.PFKOOD<>'TN' AND
Pere.PFKOOD<>'KN' AND
Pere.PNIMI is not null
ORDER BY Pere.PNIMI