Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. grouping muli values in single query ?

grouping muli values in single query ?

Scheduled Pinned Locked Moved Database
databasequestionhelp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shiva kore
    wrote on last edited by
    #1

    I have 10000 rows of schools database. i want to write query such that schools wise ,subject wise ,no_of_students scored < 35 marks. i want to use group by command how do i ???? please help me ************ S G KORE *******************

    G M 2 Replies Last reply
    0
    • S shiva kore

      I have 10000 rows of schools database. i want to write query such that schools wise ,subject wise ,no_of_students scored < 35 marks. i want to use group by command how do i ???? please help me ************ S G KORE *******************

      G Offline
      G Offline
      Goutam Patra
      wrote on last edited by
      #2

      http://www.w3schools.com/sql/sql_groupby.asp[^]

      1 Reply Last reply
      0
      • S shiva kore

        I have 10000 rows of schools database. i want to write query such that schools wise ,subject wise ,no_of_students scored < 35 marks. i want to use group by command how do i ???? please help me ************ S G KORE *******************

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        Cmon be generous, what have you got so far, give us something more that the bare question to work with. Select School,Subject, count(*) from suitable tables where score < 35 group by School,Subject Suitable tables will be the only challenge

        Never underestimate the power of human stupidity RAH

        S 1 Reply Last reply
        0
        • M Mycroft Holmes

          Cmon be generous, what have you got so far, give us something more that the bare question to work with. Select School,Subject, count(*) from suitable tables where score < 35 group by School,Subject Suitable tables will be the only challenge

          Never underestimate the power of human stupidity RAH

          S Offline
          S Offline
          shiva kore
          wrote on last edited by
          #4

          Thank you Mycroft Holmes. I tried this. but i am getting only one subject grouping data. i want is :- School name ,count(lan1 marks <35), count(Lan2 marks < 35),count(Lan3 marks <35) ......I want to know school wise No of students who have failed in all subjects. Please tell me ************ S G KORE *******************

          M 1 Reply Last reply
          0
          • S shiva kore

            Thank you Mycroft Holmes. I tried this. but i am getting only one subject grouping data. i want is :- School name ,count(lan1 marks <35), count(Lan2 marks < 35),count(Lan3 marks <35) ......I want to know school wise No of students who have failed in all subjects. Please tell me ************ S G KORE *******************

            M Offline
            M Offline
            Mycroft Holmes
            wrote on last edited by
            #5

            shiva.kore wrote:

            lan1 marks

            What does this represent in your ideas. Do you want a count of all students who scored < 35 in EVERY subject. This is quite a bit more complex and requires more knowledge of your data. Basically get a distinct list of all student/scores > 35 then get a list of all student/scores who are NOT IN the > 35 list.

            Never underestimate the power of human stupidity RAH

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups