On Tue, 2005-06-28 at 15:25 -0600, Matthew Walker wrote: > Hmmm. I need to learn to use HAVING. I'm self taught, and have always > just used WHERE. Thanks for showing us how to do this.
There's a difference although there's some overlap. WHERE operates only on single rows and occurs before GROUP BY operations. HAVING takes effect after GROUP BY and can thus work on aggregates. So you couldn't say "WHERE COUNT(col) > 3" but you could use a HAVING. Most WHERE clauses can move into a HAVING, but I'm sure it's much faster to do table joins before GROUP functions and databases may not optimize them the same way. Corey
signature.asc
Description: This is a digitally signed message part
.===================================. | This has been a P.L.U.G. mailing. | | Don't Fear the Penguin. | | IRC: #utah at irc.freenode.net | `==================================='
