title: mysql update groupwise max
body: <p>I have the following table</p>
  
  <pre><code> CREATE TABLE `data` (
  `acquire_time` decimal(26,6) NOT NULL,
  `sample_time` decimal(26,6) NOT NULL,
  `channel_id` mediumint(8) unsigned NOT NULL,
  `value` varchar(40) DEFAULT NULL,
  `status` tinyint(3) unsigned DEFAULT NULL,
  `connected` tinyint(1) unsigned NOT NULL,
  PRIMARY KEY (`channel_id`,`acquire_time`),
  UNIQUE KEY `index` (`channel_id`,`sample_time`)
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  </code></pre>
  
  <p>For each channel_id I would like to find the row with the maximum acquire time and change value to NULL, status to NULL and connected to 0. Is this possible? The manual says that you cannot update a table and select from the same table in a subquery...</p>
  
  <p>Thank you for your time.</p>