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. Sql query

Sql query

Scheduled Pinned Locked Moved Database
databasequestion
3 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.
  • P Offline
    P Offline
    Parameswar Mal
    wrote on last edited by
    #1

    hi want to find the out puts There are 2 fields namely name,mark The following are the values in the field name....mark A...........10 A...........10 B...........20 C...........15 C............5 my output should be in the form :----- name...........mark A................20 B................20 C................10 Please write a query for this ???

    C A 2 Replies Last reply
    0
    • P Parameswar Mal

      hi want to find the out puts There are 2 fields namely name,mark The following are the values in the field name....mark A...........10 A...........10 B...........20 C...........15 C............5 my output should be in the form :----- name...........mark A................20 B................20 C................10 Please write a query for this ???

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      Parameswar Mal wrote:

      Please write a query for this ???

      Please specify the route between the input and output. It is not obvious. A seems to add the marks C substracts one from the other. What are the rules for this? Given that a SQL works on SET based operations with no intrinsic order how do you work out which number should be subtracted from the other. I don't know what B does as there is only one of them.


      Upcoming events: * Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ... * Reading: Developer Day 5 Never write for other people. Write for yourself, because you have a passion for it. -- Marc Clifton My website

      1 Reply Last reply
      0
      • P Parameswar Mal

        hi want to find the out puts There are 2 fields namely name,mark The following are the values in the field name....mark A...........10 A...........10 B...........20 C...........15 C............5 my output should be in the form :----- name...........mark A................20 B................20 C................10 Please write a query for this ???

        A Offline
        A Offline
        Arun Immanuel
        wrote on last edited by
        #3

        Are you trying to find the average or sum? If C's mark is wrong, then select A,sum(mark) from tblName group by name order by name If A's mark is wrong, then select A,avg(mark) from tblName group by name order by name

        Regards, Arun Kumar.A

        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