The HAVING clause is a separate clause in the SELECT statement, similar to the WHERE clause. It works just like the WHERE clause, but it selects (grouped) rows
after the GROUPing operation. The WHERE clause selects rows
before GROUPing is done. Since COUNT is an aggregate function, you must use a GROUP by clause to arrange for rows to be grouped by the value of the 'email' column:
Code:
SELECT email FROM competition
WHERE Answer='Ripple'
GROUP BY email
HAVING COUNT(*)>1;
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com