473,387 Members | 1,504 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,387 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 1065
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.