Both QUALIFY and reusing an alias is Teradata specific. Your try with HAVING is failing, because this is the logical sequence of processing a query: To resolve this you have to use a Derived Table/Inline View and move the QUALIFY condition into the outer WHERE. The same technique must be used when you want to reuse an alias. EDIT: The 2nd query can be rewritten as:
Whether youâre trying to figure out what to pack for San Francisco in July or March, your packing list will stay more or less the same. Be sure to always bring a warm jacket, cooler layers, activewear, a day pack, sunscreen, and comfortable shoes.
San Francisco: Annual Weather Averages. July is the hottest month in San Francisco with an average temperature of 14Â°C (57Â°F) and the coldest is January at 10Â°C (50Â°F) with the most daily sunshine hours at 14 in July. The wettest month is January with an average of 119mm of rain. The best month to swim in the sea is in August when the average sea temperature is 15Â°C (59Â°F).