Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

WAR (card game)

My table consists of the following columns

inv_id, item_id, item_size, color, price and qoh(quantity on hand)

the table name is inventory

I have a query which is giving me a problem.

The query is as follows:

For each size in the INVENTORY TABLE, display the size and the average price of all items of that size.

Any ideas how to do this...

I tried the following but did not work...


select item_size, avg(price)
from inventory;

Comments

  • infidelinfidel Member Posts: 2,900
    select item_size, avg(price)
    from inventory
    GROUP BY item_size;
  • Shawn CarterShawn Carter Member Posts: 0

    _______ < http://forcoder.org /> free video tutorials and ebooks about < Ruby, MATLAB, Scratch, PL/SQL, Objective-C, Python, Delphi, PHP, Swift, R, JavaScript, C++, Visual Basic .NET, C, C#, Perl, Java, Visual Basic, Go, Assembly Alice, LabVIEW, Lua, F#, Ada, Hack, Scala, Prolog, Dart, Transact-SQL, Bash, Julia, Erlang, ABAP, Scheme, Rust, Kotlin, Awk, VBScript, Fortran, Clojure, ML, COBOL, FoxPro, D, Apex, Crystal, Lisp, SAS, Logo /> ____________

Sign In or Register to comment.