MySQLTalk.org Forum Index MySQLTalk.org
MYSQL discussions groups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

table not found

 
Post new topic   Reply to topic    MySQLTalk.org Forum Index -> MySQL General Discussion
View previous topic :: View next topic  
Author Message
wang shuming
Guest





PostPosted: Tue May 15, 2007 10:11 am    Post subject: table not found Reply with quote



Hi,
SQL like

select *,(select f1 from (select f1,date from table1 t1 where
t1.f1=table1.f1 order by date desc limit 1 ) t2 ) lastf1
from table1

shows table1.f1 not found, mysql 5.0.37 .

Thanks!
Shuming Wang
Back to top
Chris
Guest





PostPosted: Tue May 15, 2007 10:11 am    Post subject: Re: table not found Reply with quote



wang shuming wrote:
Quote:
Hi,
SQL like

select *,(select f1 from (select f1,date from table1 t1 where
t1.f1=table1.f1 order by date desc limit 1 ) t2 ) lastf1
from table1

shows table1.f1 not found, mysql 5.0.37 .

Break up your query and work out which table1 it's talking about, ie:


select f1,date from table1 t1 where t1.f1=table1.f1 order by date desc
limit 1

(I assume that will work)

Then

select f1 from (select f1,date from table1 t1 where t1.f1=table1.f1
order by date desc limit 1 ) t2


Then everything together - which ones work and which ones break ?
Back to top
Michael Dykman
Guest





PostPosted: Tue May 15, 2007 10:39 pm    Post subject: Re: table not found Reply with quote



I suggest you simplify and use distinct aliases within your queries.

- michael

On 5/15/07, Chris <dmagick (AT) gmail (DOT) com> wrote:
Quote:
wang shuming wrote:
Hi,
SQL like

select *,(select f1 from (select f1,date from table1 t1 where
t1.f1=table1.f1 order by date desc limit 1 ) t2 ) lastf1
from table1

shows table1.f1 not found, mysql 5.0.37 .

Break up your query and work out which table1 it's talking about, ie:


select f1,date from table1 t1 where t1.f1=table1.f1 order by date desc
limit 1

(I assume that will work)

Then

select f1 from (select f1,date from table1 t1 where t1.f1=table1.f1
order by date desc limit 1 ) t2


Then everything together - which ones work and which ones break ?

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=mdykman (AT) gmail (DOT) com




--
- michael dykman
- mdykman (AT) gmail (DOT) com

- All models are wrong. Some models are useful.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    MySQLTalk.org Forum Index -> MySQL General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.