0

I have this table. My task is this : Count the students having the same first name.

I want it to show me just the firstname and then how many times firstname is found:

like this: bob | 2

id      firstN   lastN      group  grade    tax     gender  year    university 
9       Alyson   Hanniga    112     1       0       female  1       UTC
5       Barney   Stinson    111     4       0       male    1       UBB
8       Bob      Saget      111     6       900     male    3       UBB
14      Bob      Bob        112     10      250     male    1       UBB
11      Cobie    Smulder    111     9       200     female  1       Dragos Voda
7       David    Henrie     112     9       0       male    1       Dragos Voda
12      Jason    Segel      112     10      150     male    1       UTC
13      Josh     Radnor     112     7       0       male    2       Dragos Voda
4       Lily     Aldrin     112     5       400     female  1       UBB
6       Lyndsy   Fonseca    113     10      0       female  3       UTC
2       Marshal  Eriksen    112     10      100     male    2       UTC
10      Neil     Patrick    112     7       0       male    3       Dragos Voda
1       Robin    Scherba    111     10      0       female  1       UBB
3       Ted      Mosby      112     8       0       male    2       UBB
3
  • pff.. well this is stupid. How can i edit this and copy/paste a table.. It wont let me post images :( Commented Jan 22, 2014 at 8:28
  • To do that you need to gain some reputation on this site. Read: FAQ for Stack Exchange sites Commented Jan 22, 2014 at 8:38
  • select firstName, count() from student group by firstName having count() > 1; Commented Jan 22, 2014 at 9:11

1 Answer 1

3

Here is query for

select FirstName,count(*) from tblStudent group by FirstName
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.