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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Complex Query

Complex Query

Scheduled Pinned Locked Moved Database
databasesql-serversysadmin
3 Posts 2 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.
  • I Offline
    I Offline
    indian143
    wrote on last edited by
    #1

    Hi All, I have to write a query in SQL Server 2000/2005/2008 in such a way that, "the sum of 1st Column 2nd row and 2nd Column 1st row is placed in 2nd column 2nd row". Any kind of link or any suggestion will be very very helpfull.

    Thanks & Regards, Md. Abdul Aleem NIIT technologies

    D 1 Reply Last reply
    0
    • I indian143

      Hi All, I have to write a query in SQL Server 2000/2005/2008 in such a way that, "the sum of 1st Column 2nd row and 2nd Column 1st row is placed in 2nd column 2nd row". Any kind of link or any suggestion will be very very helpfull.

      Thanks & Regards, Md. Abdul Aleem NIIT technologies

      D Offline
      D Offline
      Dr Walt Fair PE
      wrote on last edited by
      #2

      In other words, it sounds like column 2 is a running total of column 1. There's not a real elegant way that I know of, but it is a common problem. Did you try a search for SQL running totals[^]?

      CQ de W5ALT

      Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software

      I 1 Reply Last reply
      0
      • D Dr Walt Fair PE

        In other words, it sounds like column 2 is a running total of column 1. There's not a real elegant way that I know of, but it is a common problem. Did you try a search for SQL running totals[^]?

        CQ de W5ALT

        Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software

        I Offline
        I Offline
        indian143
        wrote on last edited by
        #3

        Thanks, I got it in Crystal Reports only. It is fixed and your link also helps me a lot if I need it in SQL Server.

        Thanks & Regards, Md. Abdul Aleem NIIT technologies

        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