WordPress.org

Ready to get started?Download WordPress

Forums

Group Query result (1 post)

  1. newboi
    Member
    Posted 2 years ago #

    Hi All,

    I have a query that returns results with duplicates. e.g.

    +---------------+-----------------+
    | Type          |  Price          |
    +---------------+-----------------+
    | Music         |  19.99          |
    | Music         |   3.99          |
    | Music         |  21.55          |
    | Toy           |  89.95          |
    | Toy           |   3.99          |
    +---------------+-----------------+

    My problem is how to group the products by type, so that it returns a single product type and total price for each product type e.g:

    Music | 45.53
    Toy | 93.94 and so on.

    Many thanks for your help in advance

    Cheers!

Topic Closed

This topic has been closed to new replies.

About this Topic