Results 1 to 11 of 11

Thread: Multiple group columns ..

Threaded View

  1. #1
    Join Date
    May 2003
    Posts
    3

    Thumbs down Multiple group columns ..

    Say I have a table looking like this:

    http://www.mysql.com/doc/en/Examples.html

    And I want to see the highest price per article:

    SELECT article, MAX(price) AS price
    FROM shop
    GROUP BY article

    That would work just fine, but what if I want to see who the dealer is ? If I try to just insert 'dealer' in the SELECT statement, it won't show me the right dealer, just the first one it finds in that particular group (like this:)

    SELECT article, MAX(price) AS price, dealer
    FROM shop
    GROUP BY article

    How do I overcome this?
    Last edited by stenkross; 05-23-2003 at 03:52 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •