June 2, 2008 at 1:50 pm
Does anyone know how to write a query that does the average for the duplicates for each name like:
Fruit Inventory
1 2
1 2
2 2
2 2
3 2
June 2, 2008 at 2:01 pm
Can you please specify what your expected result would be for the example given?
Best Regards,
Chris Büttner
June 2, 2008 at 2:09 pm
What have you tried and how isn't it right?
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
June 2, 2008 at 2:26 pm
I want a total average for fruit 1 and total average for fruit 2 in a new column that shows one row in the new column with the average for fruit 1, fruit 2, and fruit 3.
Hope this make sense.
Fruit Inventory
1 2
1 2
1 3
2 4
2 4
I want the output to be like this:
Fruit Inventory Average
1 2 ?
2 4 ?
June 2, 2008 at 2:37 pm
Try this:
Select Fruit, Inventory, '?' --you never defined "average of what?"
From FruitInventory
Group by Fruit, Inventory
Having count(*) > 1
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply