Would that be "The Guru's Guide to Transact-SQL"?
Very good book, IMO.
I see that he does say, quoting on P19, where he presents an example of a selection that should be done via a WHERE clause but instead is done in a HAVING clause:
Quote:
quote:
... SQL Server recognizes this type of HAVING misuse and translates HAVING into WHERE during query execution. Regardless of whether SQL Server catches errors like these, it's always better to write optimal code in the first place.
|
Note that Ken characterizes misplaced row selection in a HAVING clause as "misuse" and an "error". For what it is worth, I'd be leery of depending on my tool to cover my mistakes. I doubt there would be any guarantee that this kind of behavior would be supported forever in future versions of SQL Server, nor would there be any in any other product, should porting ever be an issue.
Do it right the first time. :)
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com