Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

difference between 'where' and 'having'



Hi, I have a question, that's probably really stupid, but could someone
please explain to me what difference there is between a WHERE clause and a
HAVING clause besides the syntax? I read the documentation where it states
that:

Expressions in the HAVING clause can refer both to grouped expressions and
to ungrouped expressions (which necessarily involve an aggregate function).

I've been happily working with Postgres for a long time, and not once have I
ever used a HAVING in my queries, even in fairly complex ones, and I just
can't bear the suspense anymore! :)

Thanks in advance for clearing this up for me.

Adam


Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group