-
SQL AVG question
I hava a sample database and I need to return each product_id and it's average cost. I can email someone the database id they are willing to help. Thanks
p.s. I got the numbers right for the results for each product_id but at the top where the column is suposed to be named cost it is labled Expr1001.
-
hiluxrunner
Its not clear what your question is, however as I understand it, you ant a different column name on the displayed results.
Use the column alias for that.
SUGGESTION:
Please specify the database ORACLE? etc...
-
i found it out. i was needing to find out how to name the column but i wasnt asking the question right. i had to use this statement for the sample database.....
SELECT pid, AVG(cost) AS Average
FROM Catalog AS C
Group by pid
Thanks for helping though
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|