Master Posted March 18, 2003 Share Posted March 18, 2003 SELECT day, month, year, winning_country.country_name winning_country, losing_country.country_name losing_country, matches.winning_score, matches.losing_score, location, crowd, worldcup, (matches.winning_score + matches.losing_score) as totalpoints FROM matches, countries winning_country, countries losing_country WHERE (matches.winning_country = winning_country.country_id) AND (matches.losing_country = losing_country.country_id) AND (totalpoints>50) When I run this query, I get an error saying column totalpoints does not exist. Why is that? Quote Link to comment https://forums.phpfreaks.com/topic/236-error-message/ Share on other sites More sharing options...
pallevillesen Posted March 18, 2003 Share Posted March 18, 2003 Good question, try: SELECT day, month, year, winning_country.country_name winning_country, losing_country.country_name losing_country, matches.winning_score, matches.losing_score, location, crowd, worldcup, ((matches.winning_score + matches.losing_score) as totalpoints) FROM matches, countries winning_country, countries losing_country WHERE (matches.winning_country = winning_country.country_id) AND (matches.losing_country = losing_country.country_id) AND (totalpoints>50) If that doesn\'t work, then try putting (matches.winning_score + matches.losing_score) > 50 in the WHERE clause instead... P. Quote Link to comment https://forums.phpfreaks.com/topic/236-error-message/#findComment-707 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.