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. Web Development
  3. ASP.NET
  4. how to count the column value

how to count the column value

Scheduled Pinned Locked Moved ASP.NET
databasehelptutorialquestion
4 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.
  • F Offline
    F Offline
    Fired Fish Gmail
    wrote on last edited by
    #1

    The table has columns batch_id, task_id, seq. One batch_id has several task_id and one task_id can have several seq. task_id can be A, B, C or others. I need to write a sql command that can get a table: count(task_id when task_id = value1), count (task_id when task_id = value2),... Can anyone help me that how to change the column value to be a column? :(

    M A 2 Replies Last reply
    0
    • F Fired Fish Gmail

      The table has columns batch_id, task_id, seq. One batch_id has several task_id and one task_id can have several seq. task_id can be A, B, C or others. I need to write a sql command that can get a table: count(task_id when task_id = value1), count (task_id when task_id = value2),... Can anyone help me that how to change the column value to be a column? :(

      M Offline
      M Offline
      meeram395
      wrote on last edited by
      #2

      This is not relating to ASP.Net. Post the query in proper forum.

      Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.

      1 Reply Last reply
      0
      • F Fired Fish Gmail

        The table has columns batch_id, task_id, seq. One batch_id has several task_id and one task_id can have several seq. task_id can be A, B, C or others. I need to write a sql command that can get a table: count(task_id when task_id = value1), count (task_id when task_id = value2),... Can anyone help me that how to change the column value to be a column? :(

        A Offline
        A Offline
        Abhishek Sur
        wrote on last edited by
        #3

        Use Pivot.... Check this : http://technet.microsoft.com/en-us/library/ms177410.aspx[^]:thumbsup: Is this the right place to ask this. There is separate forum for this. :mad:

        Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


        My Latest Articles-->** Windows7 API Code Pack
        Simplify Code Using NDepend
        Basics of Bing Search API using .NET

        F 1 Reply Last reply
        0
        • A Abhishek Sur

          Use Pivot.... Check this : http://technet.microsoft.com/en-us/library/ms177410.aspx[^]:thumbsup: Is this the right place to ask this. There is separate forum for this. :mad:

          Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


          My Latest Articles-->** Windows7 API Code Pack
          Simplify Code Using NDepend
          Basics of Bing Search API using .NET

          F Offline
          F Offline
          Fired Fish Gmail
          wrote on last edited by
          #4

          Thanks for you answer and your reminding.

          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