Jump to content

Error message


Master

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?

Link to comment
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.