MySQL Forums
Forum List  »  General

Re: count(...) does not exist error
Posted by: Peter Brawley
Date: June 09, 2014 04:57PM

As the manual page on Joins sez, it's a bad idea to mix comma joins and explicit joins in the same query. You need ...

SELECT 
  users_child.count(userid), 
  u.*,
  g.description as tgender 
FROM users 
JOIN elgender as g ON users.oidgender = g.oid
LEFT JOIN users_child ON users.userid = users_child=userid 
WHERE venue_id = %s ;

And a suggestion: you might save a couple of microseconds by omitting formatting carriage returns and indenting spaces from a query, but you'll save much more time in debugging and maintenance time, so consider always formatting your queries as above so errors are easily spotted and changes are easily made.

Options: ReplyQuote


Subject
Written By
Posted
Re: count(...) does not exist error
June 09, 2014 04:57PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.