473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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 -------------
Mar 27 '08 #1
2 1062
sukatoa
539 512MB
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...
Mar 27 '08 #2
r035198x
13,262 8TB
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.
Mar 27 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: joemyre | last post by:
Hi everyone, What I'm trying to do is take php variables i got from user input, and pass them as the MySQL query terms. $query = "select * from ident where ".$searchtype1."=".$searchterm1."";...
16
by: cover | last post by:
I have a form with drop down menus to query for name, month, and year to capture activity accordingly by an individual for a given month and given year. But I'd like to also be able to query ALL...
3
by: Nick Truscott | last post by:
<? // scoreinput.php - input a match score when match selected from list ?> <html> <head> <basefont face="Verdana"> </head> <body>
0
by: ChangAya | last post by:
I use binary log on mysql system. Yesterday i found some hacking attempt on my machine. ( I found some unknown queries on binary log) But i don't get any information about hacking query...
8
by: Együd Csaba | last post by:
Hi All, how can I improve the query performance in the following situation: I have a big (4.5+ million rows) table. One query takes approx. 9 sec to finish resulting ~10000 rows. But if I run...
4
by: Steve | last post by:
I have a products table where the PK is ProductID. Also have the standard Orders table and OrderDetails table. I created a query that joins the Orders table and OrderDetails table. The query...
3
by: Tom Mitchell | last post by:
All: I'm stumped on a query. How do I find duplicates in a table where one of the duplicates has values is a certain field and the other doesn't. For example, I have the following table: ...
1
by: Nicolae Fieraru | last post by:
Hi All, I want to find if there is a different way than the way I am working now. Lets say I have a table, tblCustomers containing address details. I want a report with all the customers from...
5
by: Ryan Hubbard | last post by:
Is it possible to get the recordset from an open query window? So you run the query. The window is open. Can vba retrieve this data?
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.