16 July 2018        Add to Favorites   Report

What is the difference between Qualify and Having - Teradata

Having can be used only when we can do a group-by clause
Whereas we can use Qualify without having to group anything


QUALIFY
is a proprietary extension to filter the result of a Windowed Aggregate Function

A query is logically processed in a specific order:

  1. FROM: create the basic result set
  2. WHERE: remove rows from the previous result set
  3. GROUP BY: apply aggregate functions on the previous result set
  4. HAVING: remove rows from the previous result set
  5. OVER: apply windowed aggregate functions on the previous result set
  6. QUALIFY: remove rows from the previous result set
Copied