How to find Double Majors in a statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rg3480
    New Member
    • May 2007
    • 3

    How to find Double Majors in a statement

    have 2 colums, one with the list of all students id number and if they are in a double major their id is listed 2 times in the colum. The next colum is the id of the specific business scholl they are in (accounting, mis...)
    How do I find out specifily how many double majors are in mis with accounting or with finance ect. in an SQL statment?


    id major code

    rt1245 bs223
    rt1245 bs224(this person is a double major)
    rs235 bs223
  • sandyboy
    New Member
    • May 2007
    • 16

    #2
    Originally posted by rg3480
    have 2 colums, one with the list of all students id number and if they are in a double major their id is listed 2 times in the colum. The next colum is the id of the specific business scholl they are in (accounting, mis...)
    How do I find out specifily how many double majors are in mis with accounting or with finance ect. in an SQL statment?


    id major code

    rt1245 bs223
    rt1245 bs224(this person is a double major)
    rs235 bs223

    Can you try this

    SELECT id,majorcode FROM Table_name GROUPBY id,majorcode HAVING count(id)>1

    Comment

    Working...