Skip to main content

How to use alias column name in where clause - Mysql


Example
SELECT  name,count (*) AS count FROM `emp` WHERE count <5

Instead of the above use
SELECT name, count(*) AScount FROM `book` WHERE condition  HAVING count <5
Instead of  WHERE clause use HAVING clause.

Comments