Mysql

Hi i have a database with many rows. So i want to make a query to select all number for example i have category 2,3,4,5,2,2,2,2,2,3,4,4,5,3,1 so i want to mysql delete every category which repeat.
LVL 1
umaximAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

IrishStudentCommented:
I'd need to see your table structure, what is the purpose of this number.
0
umaximAuthor Commented:
id       int(11)                   No             auto_increment       Browse distinct values       Change       Drop       Primary       Unique       Index       Fulltext
      num       varchar(20)       utf8_general_ci             No                   Browse distinct values       Change       Drop       Primary       Unique       Index       Fulltext
      desc_text       text       utf8_general_ci             No                   Browse distinct values       Change       Drop       Primary       Unique       Index       Fulltext
      category       text       utf8_general_ci             No                   Browse distinct values       Change       Drop       Primary       Unique       Index       Fulltext
      sponsor       text       utf8_general_ci             No                   Browse distinct values       Change       Drop       Primary       Unique       Index       Fulltext
      title       text       utf8_general_ci             No                   Browse distinct values       Change       Drop       Primary       Unique       Index       Fulltext
      image       varchar(20)       utf8_general_ci             No                   Browse distinct values       Change       Drop       Primary       Unique       Index       Fulltext
0
umaximAuthor Commented:
CREATE TABLE `prizes` (
  `id` int(11) NOT NULL auto_increment,
  `num` varchar(20) NOT NULL,
  `desc_text` text NOT NULL,
  `category` text NOT NULL,
  `sponsor` text NOT NULL,
  `title` text NOT NULL,
  `image` varchar(20) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8 AUTO_INCREMENT=14 ;
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

umaximAuthor Commented:
The numbers is category. I want to get all category and make as menu
0
TimBareCommented:
Do you want to delete duplicates, or get all of a single category to create a menu item w/ sub-menus, then the next category, etc?
0
umaximAuthor Commented:
i want to get list of it. Just list so i can use it in menu. like
12
22
33
44
0
Chris StanyonWebDevCommented:
Give this a go
SELECT DISTINCT category FROM prizes ORDER BY category;

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jessegivyDeveloperCommented:
The most standard way to accomplish this would be with a look-up table and foreign key to the table you speak of...

Mr. Stanyon does have the short answer of course *hat tip*.  If you're expecting the table to have over a couple thousand rows you might want to convert it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.