How do i get the totals of the quantity of each item?

Discussion in 'MySQL' started by netpox, Nov 2, 2009.

  1. #1
    My mysql database has a table called items inside there are 132 records. Each record has a row named quantity and it has a number in it.

    I want to find out how many total i have. Bascially this is a inventory database and for each item in the inventory it has quantity but i want to find out the total inventory.

    What would my mysql query be?
     
    netpox, Nov 2, 2009 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    SELECT SUM(qty_column) AS total_in_inventory FROM my_table;
     
    jestep, Nov 2, 2009 IP