title: Group by - multiple conditions - MySQL
body: <p>How can I combine 2 group by conditions? I have records for each id for every hour in a day and I want to group information by first id and all records for that id in that day then second id and all records for that in the day.</p>
  
  <p>My sample query is this:</p>
  
  <pre><code>SELECT
      r.name
    , r.network
    , r.namestring
    , i.name
  , i.description
    , r.rid
    , i.id
    , d.dtime
    , d.ifInOctets
  FROM router AS r
  INNER JOIN interface AS i
  ON r.rid = i.rid
  INNER JOIN 1279080000_1_60 AS d
  ON i.id = d.id
  AND dtime BETWEEN 1279113600 AND 1279115400
  WHERE r.network = "ITPN"
  AND i.status = "active"
  GROUP BY i.id AND d.dtime              // each id with all its dtime
  </code></pre>
  
  <p>This always ends up giving me an aggregate value for that id. 
  Any idea what I could use??? I don't want to sum up all values.</p>
  
  <p>Thank you,</p>