select the frequency member ID in MYSQL

How can I select maximim top frequency duplicate MembeID
CREATE TABLE `insurance` (
  `insurprimarykey` int(11) NOT NULL AUTO_INCREMENT,
  `Insurkey` int(11) DEFAULT '0',
  `MembeID` int(11) DEFAULT NULL,
  `MemberName` varchar(250) DEFAULT NULL,
  `Amount` decimal(11,0) DEFAULT NULL,  
  PRIMARY KEY  (`insurprimarykey`),
  KEY `Membe ID` (`MembeID`)
) ENGINE=InnoDB AUTO_INCREMENT=401 DEFAULT CHARSET=tis620;

Open in new window

teeraAsked:
Who is Participating?
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.

Jinesh KamdarCommented:
SELECT `MembeID`, COUNT(*) cnt FROM `insurance`
GROUP BY `MembeID` ORDER BY cnt DESC LIMIT 1
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
HuyBDCommented:
try this
select top 1 * from(
select MembeID ,count(*) as c from insurance
group by MembeID) as t
order by c desc

Open in new window

0
Jinesh KamdarCommented:
@HuyBD: Just for my learning, does TOP 1 work in MySQL as well ?
0
HuyBDCommented:
sorry,
select * from(
select MembeID ,count(*) as c from insurance
group by MembeID) as t
order by c desc
limit 1

Open in new window

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
Query Syntax

From novice to tech pro — start learning today.