title: MYSQL: Select the highest ID from two colums and sort
body: <pre><code>SELECT
      u.uid, 
      u.name, 
      u.description, 
      u.url, 
      u.picurl, 
      u.mapurl, 
      MAX(p.pid) AS MaxPriceID,
      p.price,
      p.uid,
      MAX(r.rid) AS MaxRatingID,
      r.rating,
      r.uid
  FROM
      utested u
          JOIN price p
              ON u.uid=p.uid
          JOIN rating r
              ON u.uid=r.rid
  GROUP BY u.uid, u.name
  </code></pre>
  
  <p>This query displays what I need but it does not display the correct values.</p>
  
  <p>I want to display the HIGHEST PID and RID
  I get the highest PID and RID but not the highest price and rating. </p>
  
  <p>There are 3 tables. </p>
  
  <p>Can anybody help me?</p>