Jump to content

Recalling unique field entries from MySQL


neo926

Recommended Posts

Okay, I don't know the proper way to query my db, and I'm not adept enough to find what I'm looking for in the MySQL Manual.

So, I have a table that contains all my data for various sports columns that have been written. I have fields for author, sport, title, content, and date submitted.

What I would like is to be able to query the db in a way so that it can recall the different sports that have been written about, but I don't want the same sport repeated. For example, let's say that there are currently 7 columns in the db, and if I were to recall the sports field on each column I would get the following list:

football
baseball
football
soccer
hockey
hockey
basketball

I want to be able to query the db and have it give me the following list instead:

football
baseball
soccer
hockey

That way any duplicate entries aren't produced. Thanks in advance for any help.
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.