Hi,
I'm am looking for a little help. I need to create a SQL view which
joins a few tables, and I need to return an average for a particular
column where a second duplicate ID exists...
Heres an example of how the results could be returned...
ID | Name | Order No. | Value
---+------+-----------+---------
5 | test | 1234 | 3
5 | test2| 1234 | 4
5 | test3| 1234 | 3
5 | void | 1235 | 5
5 | void2| 1235 | 6
5 | void3| 1235 | 5
5 | void4| 1235 | 7
ID is my main join which joins the tables
Name is a unique name
Order No is the same for the different names, I only need to return one
row with this order no, and the first name (the rest are irrelevant)
Value is the field which I wish to return as an average of all 3, 4 or
however many rows is returned and share the same order no. This is
where I get totally lost as I am pretty new to SQL. Can anyone provide
any help on how I would go about limiting this query to the unique
order no's and returning the average of the value field, and I can take
it from there with my own tables.
Thanks for your help
str8