I suggest you simplify and use distinct aliases within your queries.
- michael
On 5/15/07, Chris <dmagick@stripped> wrote:
> 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=1
>
>
--
- michael dykman
- mdykman@stripped
- All models are wrong. Some models are useful.