Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Name	Project
Sujata	abcd.com
Sujata	ghj.com
Sujata	lok.com
Rishi	k.com
Rishi	l.com
Ram	ol.com
Ram	ui.com
Ram	p.com
Ram	lp.com


** Need a query who has maximum number of project


What I have tried:

Name	Project
Sujata	abcd.com
Sujata	ghj.com
Sujata	lok.com
Rishi	k.com
Rishi	l.com
Ram	ol.com
Ram	ui.com
Ram	p.com
Ram	lp.com




** Need a query who has maximum number of project
Posted
Updated 24-Mar-17 19:59pm

1 solution

This idea will be to count the number of project by each name (group by), sort them by the count in descending order (order by desc), then pick the top 1, try this:
select top 1 name, count(project) from projecttable group by name order by count(project) desc
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900