Subject | Re: [firebird-support] Re: Trouble with BETWEEN operator |
---|---|
Author | Anderson Farias |
Post date | 2008-04-11T12:07:54Z |
Hi Helen,
SELECT SOMEFIELD FROM SOME TABLE HAVING COUNT(*)=x;
will not work couse the engine spects a 'group by' clause.. BUT OTOH:
SELECT SOMECONSTANT FROM SOME TABLE HAVING COUNT(*)=x;
Does work couse is much like
SELECT COUNT(*), SOMECONSTANT
FROM SOME TABLE HAVING COUNT(*)=x;
So... no need for a group by.
Regards,
Anderson Farias
> HAVING is not valid except with respect to GROUP BY.That really 'depends'
SELECT SOMEFIELD FROM SOME TABLE HAVING COUNT(*)=x;
will not work couse the engine spects a 'group by' clause.. BUT OTOH:
SELECT SOMECONSTANT FROM SOME TABLE HAVING COUNT(*)=x;
Does work couse is much like
SELECT COUNT(*), SOMECONSTANT
FROM SOME TABLE HAVING COUNT(*)=x;
So... no need for a group by.
Regards,
Anderson Farias