Use column alias in conditions
With the use of HAVING you can use a result columns of a database query in itself: SELECT category_field = 3 AS ‘result’ FROM catalog_category_entity WHERE condition_field = 985 HAVING result = 1; Here the alias result (see AS ‘result’) for the only column is used as a condition with HAVING. That is by now […]