 |
MySQLTalk.org MYSQL discussions groups
|
| View previous topic :: View next topic |
| Author |
Message |
wang shuming Guest
|
Posted: Tue May 15, 2007 10:11 am Post subject: table not found |
|
|
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
|
Posted: Tue May 15, 2007 10:11 am Post subject: Re: table not found |
|
|
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
|
Posted: Tue May 15, 2007 10:39 pm Post subject: Re: table not found |
|
|
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 |
|
 |
|
|
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
|
|