tech user wrote:
Add an alias for the subquery

  select * from ( select .... ) my_alias where dd >= 3;

Better, use a having clause and eliminate the subquery. Odds are it will be more efficient in MySQL.


How to replace the original one with a having statement?
Thanks again.

select uin,count(*) as dd from active_users
where date >= date_add(curdate(),interval -30 day) group by uin
having count(*) >=3;




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to