where是对原始数据进行过滤,而HAVING是对分组以后的数据进行过滤的。 destinc不仅可以针对单个重复的字段,还可以针对两个以上重复的行。 datediff date datepart cast convert isnull case