SELECT DISTINCT P.AREA_CODE, P.PHONE_NO,

      (SELECT COUNT(*) 

        FROM PHONE P2 

       WHERE P2.PHONE_ID = P.PHONE_ID) AS CNT

  FROM PHONE P              

 WHERE P.AREA_CODE IS NOT NULL 

 GROUP BY 1, 2          

HAVING (SELECT COUNT(*) 

          FROM PHONE P3 

         WHERE P3.PHONE_ID = P.PHONE_ID

           AND P3.AREA_CODE IS NOT NULL) > 1

 

Dynamic SQL Error SQL error code = -104 Invalid expression in the select list 
(not contained in either an aggregate function or the GROUP BY clause)

  • [firebird-... 'stwizard' stwiz...@att.net [firebird-support]
    • Re: [... 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
      • R... 'stwizard' stwiz...@att.net [firebird-support]
    • Re: [... Tomasz Tyrakowski t.tyrakow...@sol-system.pl [firebird-support]
      • R... 'stwizard' stwiz...@att.net [firebird-support]

Reply via email to