Jump to content

Archived

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

neo926

Recalling unique field entries from MySQL

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.

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.