Results 1 to 3 of 3

Thread: SQL AVG question

  1. #1
    Join Date
    Mar 2003

    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.

  2. #2
    Join Date
    Mar 2003

    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.

    Please specify the database ORACLE? etc...

  3. #3
    Join Date
    Mar 2003
    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