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. Any query??

Any query??

Scheduled Pinned Locked Moved Database
questiondatabasesales
5 Posts 5 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.
  • O Offline
    O Offline
    omegazafer
    wrote on last edited by
    #1

    Hi friends, I have below salesreport table, how can I get results of max sales of sales persons in one query? salesperson sales orderId Michele 120 120121 Guido 230 120122 Michele 300 120123 Michele 250 120124 Franco 100 120125 Guido 500 120126 Franco 400 120127 the query result must be; salesperson sales Michele 300 Guido 500 Franco 400

    C G 2 Replies Last reply
    0
    • O omegazafer

      Hi friends, I have below salesreport table, how can I get results of max sales of sales persons in one query? salesperson sales orderId Michele 120 120121 Guido 230 120122 Michele 300 120123 Michele 250 120124 Franco 100 120125 Guido 500 120126 Franco 400 120127 the query result must be; salesperson sales Michele 300 Guido 500 Franco 400

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      select salesperson, max(sales) from salesreporttable group by salesperson

      :wtf: :wtf: :wtf: :wtf: Did you use to work in sales?

      Chris Meech I am Canadian. [heard in a local bar] Donate to help Conquer Cancer[^]

      P 1 Reply Last reply
      0
      • C Chris Meech

        select salesperson, max(sales) from salesreporttable group by salesperson

        :wtf: :wtf: :wtf: :wtf: Did you use to work in sales?

        Chris Meech I am Canadian. [heard in a local bar] Donate to help Conquer Cancer[^]

        P Offline
        P Offline
        Paul Conrad
        wrote on last edited by
        #3

        Chris Meech wrote:

        Did you use to work in sales?

        :laugh::laugh::laugh:

        "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

        1 Reply Last reply
        0
        • O omegazafer

          Hi friends, I have below salesreport table, how can I get results of max sales of sales persons in one query? salesperson sales orderId Michele 120 120121 Guido 230 120122 Michele 300 120123 Michele 250 120124 Franco 100 120125 Guido 500 120126 Franco 400 120127 the query result must be; salesperson sales Michele 300 Guido 500 Franco 400

          G Offline
          G Offline
          GuyThiebaut
          wrote on last edited by
          #4

          Please do not post on multiple forums. I also answered your question on the C# forum. If I had looked at this forum first I would not have posted on the C# forum - so you wasted about 30 minutes of my time(well it was a pretty tough question :laugh: ). Guy

          You always pass failure on the way to success.
          K 1 Reply Last reply
          0
          • G GuyThiebaut

            Please do not post on multiple forums. I also answered your question on the C# forum. If I had looked at this forum first I would not have posted on the C# forum - so you wasted about 30 minutes of my time(well it was a pretty tough question :laugh: ). Guy

            You always pass failure on the way to success.
            K Offline
            K Offline
            KANGAROO_
            wrote on last edited by
            #5

            plz dont laugh to anyone......he/she is member of our codeproject family.. :) :) :) :rose:

            manoj Kumar Jha "Learn to smile at every situation. See it as an opportunity to prove your strength and ability."

            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