Jump to content

Archived

This topic is now archived and is closed to further replies.

Master

Error message

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.