MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Tompkins Neil Date:February 4 2011 10:22am
Subject:Re: Unknown column 'users.users_id' in 'where clause'
View as plain text  
Thanks, but how can I pass the current users value from the other query ?

On Thu, Feb 3, 2011 at 4:22 PM, Simcha Younger <simcha@stripped> wrote:

> On Thu, 3 Feb 2011 13:55:36 +0000
> Tompkins Neil <neil.tompkins@stripped> wrote:
>
> > SELECT DISTINCT(away_teams_id) AS teams_id
> > FROM fixtures_results
> > WHERE (fixtures_results.away_users_id = *users.users_id*)
>
> > Any ideas why I'm getting Unknown column 'users.users_id' in 'where
> clause'
> > for the part of the statement that I've marked as *bold* and how I can
> over
> > come this problem ?
>
> You have to add the users table to the subquery.
> Your subquery only has the fixtures_results table in the 'from' clause, and
> the subquery is not aware of the tables you use in the outer query.
>
> --
> Simcha Younger <simcha@stripped>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=1
>
>

Thread
Unknown column 'users.users_id' in 'where clause'Tompkins Neil3 Feb
  • Re: Unknown column 'users.users_id' in 'where clause'Simcha Younger3 Feb
    • Re: Unknown column 'users.users_id' in 'where clause'Tompkins Neil4 Feb