New to This and Dought in Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • geetark
    New Member
    • Mar 2008
    • 1

    New to This and Dought in Query

    Hi
    I am new to This Forum
    I am doing my project in databases i.e writing the queries
    I need some suggestions from you experienced programmers
    I have the table with the fileds Sno,Close,Avg
    after 10 th row i have to find avg of all closes form 1 to 10 and display as avg colum
    in 12 th row i have to discard the colum value of close 1 and find the avg of close from 2 to 11
    13 th row i have to discard the colum value of close 2 and find the avg of close from 3 to 12
    when i am inserting the new row in the table ,i have to find the avg of 10 closes from this close value
    like so on --------------------------------
    fro eg
    Sno close avg
    1 11 null
    .
    ;
    ,
    .
    10 123 null
    11 231 avg(close(1 to 10)
    12 211 avg(close(2 to 11)
    13 123 avg(close(3 to 12)

    can any one tell me how to write this query
    Plz -------------
  • sukatoa
    Contributor
    • Nov 2007
    • 539

    #2
    Originally posted by geetark
    Hi
    I am new to This Forum
    I am doing my project in databases i.e writing the queries
    I need some suggestions from you experienced programmers
    I have the table with the fileds Sno,Close,Avg
    after 10 th row i have to find avg of all closes form 1 to 10 and display as avg colum
    in 12 th row i have to discard the colum value of close 1 and find the avg of close from 2 to 11
    13 th row i have to discard the colum value of close 2 and find the avg of close from 3 to 12
    when i am inserting the new row in the table ,i have to find the avg of 10 closes from this close value
    like so on --------------------------------
    fro eg
    Sno close avg
    1 11 null
    .
    ;
    ,
    .
    10 123 null
    11 231 avg(close(1 to 10)
    12 211 avg(close(2 to 11)
    13 123 avg(close(3 to 12)

    can any one tell me how to write this query
    Plz -------------
    Welcome to TSDN... ;-)

    It would be nice if you post this thread in an appropriate forum...

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by geetark
      Hi
      I am new to This Forum
      I am doing my project in databases i.e writing the queries
      I need some suggestions from you experienced programmers
      I have the table with the fileds Sno,Close,Avg
      after 10 th row i have to find avg of all closes form 1 to 10 and display as avg colum
      in 12 th row i have to discard the colum value of close 1 and find the avg of close from 2 to 11
      13 th row i have to discard the colum value of close 2 and find the avg of close from 3 to 12
      when i am inserting the new row in the table ,i have to find the avg of 10 closes from this close value
      like so on --------------------------------
      fro eg
      Sno close avg
      1 11 null
      .
      ;
      ,
      .
      10 123 null
      11 231 avg(close(1 to 10)
      12 211 avg(close(2 to 11)
      13 123 avg(close(3 to 12)

      can any one tell me how to write this query
      Plz -------------
      Hi and welcome to TSDN. Hope you'll have a great time here.
      Remember to read the posting guidelines.

      Comment

      Working...