I thought it would be an empty result but wasn't positive decided to "test" and created the table. I got this message on executing the query:
Msg 8121, Level 16, State 1, Line 4
Column 'QotD.col2' is invalid in the HAVING clause because it is not contained in either an aggregate function or the GROUP BY clause.
This is from BOL:
"The HAVING clause is typically used together with the GROUP BY clause to filter the results of aggregate values. However, HAVING can be specified without GROUP BY. The HAVING clause specifies additional filters that are applied after the WHERE clause filters. These filters can be applied to an aggregate function used in the select list."
I don't know if the version of SQL makes a difference, but I am using SQL Server 2008 R2
"There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies."
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.