Syntax problem Informix with COUNT and HAVING
Posted on 1998-10-29
I try to do the following query (which I thought is plain SQL), but it results in an error:
GROUP BY person_id
HAVING COUNT(person_id) > 1
(IN NL: Give me all person_id's of those rows in the table that have this person_id more than once, which means, "Give me all persons with more than one function").
The database complains that the syntax is not OK. It isn't usefull, but when I put a distinct inside the COUNT, the answer of course is wrong, but the syntax seems right.... It seems the problem is a COUNT(field) is not supported, whereas a COUNT(*) is supported.
The database used is a very stripped Informix that was delivered with the Netscape Enterprise 2.0 webserver, with LiveWire Pro....
I think it's just a difference in syntax....