tech user wrote:
hello,
I try to execute this sql in mysql shell,but got error as:
mysql> select * from (select uin,count(*) as dd from active_users where
date >= date_add(curdate(),interval -30 day) group by uin) where dd >=3;
ERROR 1248 (42000): Every derived table must have its own alias
But I can execute the sql statement of "select uin,count(*) as dd from
active_users where date >= date_add(curdate(),interval -30 day) group by
uin" successfully.
How to fixup it? thanks!
Get the name you always wanted with the new y7mail email address.
www.yahoo7.com.au/y7mail
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.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]