Jump to content

MySQL query not working


Recommended Posts

i have just started learning php and mysql on my own after installig fedora 5 on my laptop just a week ago. i have creatd a table (winners) in mysql (from command line) and it has 2 columns. one is countryName and another is year. just like country and the year it won the football world cup. i want to make a query in terms of the names of the country/countries who have won the cup more than say 2 times. but i m struggling with it can any one help. the query i have created is

 

select countryName,count(*) as numberOfWins from winners where count(*)>2 group by country order by numberOfWins asc;

 

thanks.

Link to comment
Share on other sites

Not sure about the count bit as of yet, but what will get you the records would be something like:

 

select * from countryName where countryName=('UK');

 

for example, would pull records for UK.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

Loading...
 Share

×
×
  • Create New...