title: MySQL: select last (max) value from column and count of all rows
body: <p>How can I select last (=max) value from column and count of all rows in single query?</p>
  
  <pre><code>ID      ITEM_ID       VALUE
  1       1             100
  2       1             101
  3       2             201
  4       3             333
  5       2             222
  6       1             111
  </code></pre>
  
  <p>I want to select last / max value for particular ITEM_ID and count of all rows with this ID.
  For ITEM_ID = 1 thus:</p>
  
  <pre><code>VALUE      COUNT
  111        3
  </code></pre>
  
  <p>My query is like this:</p>
  
  <pre><code>SELECT (SELECT COUNT(*) FROM table) AS count, (SELECT value FROM table ORDER BY id DESC LIMIT 1) AS value FROM table WHERE item_id = 1 LIMIT 1
  </code></pre>
  
  <p>It works but looks ... weird. Is there any better (simpler / faster) solution? Thanks</p>