RE: [firebird-support] SQL Error Code -104: What is wrong with this rather simply SQL?

2016-04-07 Thread 'stwizard' stwiz...@att.net [firebird-support]
there can be multiple PHONE_ID’s per AREA_CODE, PHONE_NO Kind Regards, Arno Brinkman From: mailto:firebird-support@yahoogroups.com Sent: Wednesday, April 6, 2016 10:03 PM To: firebird-support@yahoogroups.com Subject: [firebird-support] SQL Error Code -104: What is wrong with this rather

RE: [firebird-support] SQL Error Code -104: What is wrong with this rather simply SQL?

2016-04-07 Thread 'stwizard' stwiz...@att.net [firebird-support]
Tomasz, Thanks for your guidance and explanation for a much simpler solution. Mike From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Sent: Thursday, April 07, 2016 2:58 AM To: firebird-support@yahoogroups.com Subject: Re: [firebird-support] SQL Error Code

Re: [firebird-support] SQL Error Code -104: What is wrong with this rather simply SQL?

2016-04-07 Thread Tomasz Tyrakowski t.tyrakow...@sol-system.pl [firebird-support]
On 06.04.2016 o 22:03, 'stwizard' stwiz...@att.net [firebird-support] wrote: > 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

Re: [firebird-support] SQL Error Code -104: What is wrong with this rather simply SQL?

2016-04-06 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Regards, Arno Brinkman From: mailto:firebird-support@yahoogroups.com Sent: Wednesday, April 6, 2016 10:03 PM To: firebird-support@yahoogroups.com Subject: [firebird-support] SQL Error Code -104: What is wrong with this rather simply SQL? SELECT DISTINCT P.AREA_CODE, P.PHONE_NO

[firebird-support] SQL Error Code -104: What is wrong with this rather simply SQL?

2016-04-06 Thread 'stwizard' stwiz...@att.net [firebird-support]
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