• Home
  • ASP.NET
  • JavaScript
  • SQL
  • WebService
  • OOPs
  • Jquery
  • GridView
  • MVC

SQL

we have a table  id and name
                                 id              value
                                  1              (10) 
                                  2               (20),
                                  3                (30),
                                   4               (40),
                                   5                (50); 
                                   6                (60);
write a query for this output
                                  id              value
                                  1              (10) 
                                  2               (30),
                                  3                (60),
                                   4               (100),
                                   5                (150); 
                                   6                (210);
select t1.value, (select sum(t2.value) from tblname t2 where t2.value<=t1.value)as new  from tblname t1


0 comments:

Post a Comment

Home

Popular Posts

Pages

  • Home
  • SQL
  • Asp-Net
  • GridView
  • Javascript
  • What are HttpHandlers and HttpModules in ASP.NET?

Blog Archive

  • March 2016 (12)
  • February 2016 (16)

Contact Form

Name

Email *

Message *

Followers

Follow us

  • Facebook
  • Twitter
  • Instagram
  • Pinterest
  • Bloglovin
  • Youtube

Copyright © Code Wrapper | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates