Re: help with a sql statement

2008-04-01 Thread paul rivers
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.

help with a sql statement

2008-03-31 Thread tech user
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

Re: help with a sql statement

2008-03-31 Thread paul rivers
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

Re: help with a sql statement

2008-03-31 Thread tech user
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. Get the name you

Re: Help needed for SQL statement

2005-10-25 Thread Alvaro Cobo
PROTECTED] To: mysql@lists.mysql.com Sent: Monday, October 24, 2005 11:43 PM Subject: Help needed for SQL statement Hi, I have such a situation: There is a table with gene_ids and clone_ids. Each gene only resides on a single clone and each clone may contain multiple genes. How do would I

Help needed for SQL statement

2005-10-24 Thread Xiaobo Chen
Hi, I have such a situation: There is a table with gene_ids and clone_ids. Each gene only resides on a single clone and each clone may contain multiple genes. How do would I find how many genes are on each and every clone? Thanks in advance. X.Chen -- MySQL General Mailing List For list

Help with an SQL statement

2001-01-12 Thread Mike Podlesny
Thanks for everyone's help with the dat question now I would like to know if someone could help me with another question. I have a table called COUNTER and a field in the table called HITS in an SQL statement I would like to update this field by adding 1 to it's current value any ideas? Thanks,