Re: SQL count question
Posted in 1997
Matt :
Have you tried it with the having clause ?.
select fname,count(*) from customer
group by fname
having count(*) > 1
--
Rajiv Jhaveri (rajivp@qsun.ho.att.com)
Matt Brickley wrote:
} On SE 5.01, SCO Unix 3.2v4.2
} I am trying to use the aggregate count(*) to select rows where
} there are more than on occurrance.
}
} The Informix guide to SQL on pg 7-377 shows this statement:
}
} select fname,count(*) from customer
} group by fname
} where count(*) > 1
}
} This format gave me a syntax error
}
} When I put the where before the group by like this:
}
} select fname,count(*) from customer
} where count(*) > 1
} group by fname
}
} I get a 595 - Bad use of aggregate in this context
}
} How do I do it?
}
} TIA,
} Matt Brickley