List:General Discussion« Previous MessageNext Message »
From:João Cândido de Souza Neto Date:October 10 2006 2:04pm
Subject:Re: SQL statement work in mysql4 but not mysql5
View as plain text  
I had this problem here and i change my query to:

SELECT f.*, c.id as cat_id, c.position as cat_position, c.state as
cat_state, c.name as cat_name, c.description as cat_desc,
             c.image, c.url, m.member_name as mod_name, m.member_id as
mod_id, m.is_group, m.group_id, m.group_name, m.mid
             FROM ibf_forums f
               INNER JOIN ibf_categories c on f.id_cat=c.id_cat
               LEFT JOIN ibf_moderators m ON (f.id=m.forum_id)
             WHERE c.id=f.category
             ORDER BY c.position, f.posit

It works fine to me.



""Jason Chan"" <eg_ckhag@stripped> escreveu na mensagem 
news:egg8kn$v31$1@ style="color:#666">stripped...
>I am going to upgrade my database from version 4 to 5.
> However I found some of my web application doesn't work on MySQL5
>
> e.g following statement works in 4 but not 5
>
> SELECT f.*, c.id as cat_id, c.position as cat_position, c.state as
> cat_state, c.name as cat_name, c.description as cat_desc,
>             c.image, c.url, m.member_name as mod_name, m.member_id as
> mod_id, m.is_group, m.group_id, m.group_name, m.mid
>             FROM ibf_forums f, ibf_categories c
>               LEFT JOIN ibf_moderators m ON (f.id=m.forum_id)
>             WHERE c.id=f.category
>             ORDER BY c.position, f.position
>
> Error:
> Unknown column 'f.id' in 'on clause'
>
> The alias seem not working?
> What should I do, I dont want to rewrite all my sql statement....
>
> Thanks.
>
> Jason
>
>
>
> 


Thread
SQL statement work in mysql4 but not mysql5Jason Chan10 Oct
  • Re: SQL statement work in mysql4 but not mysql5joao10 Oct
  • Re: SQL statement work in mysql4 but not mysql5Peter Brawley10 Oct