title: Add a field and insert an increment value
body: <p>I have this table :</p>
  
  <pre><code>id   ref     data
  1    111     data1
  2    111     data2
  3    111     data3
  4    111     data4
  5    222     data1
  6    222     data2
  7    222     data3
  8    333     data1
  9    333     data2
  </code></pre>
  
  <p>and I'd like to insert a new field, called for example <em>order</em>, where for each ref, I'll set a crescent value. So the output should be :</p>
  
  <pre><code>id   ref     data    order
  1    111     data1   1
  2    111     data2   2
  3    111     data3   3
  4    111     data4   4
  5    222     data1   1
  6    222     data2   2
  7    222     data3   3
  8    333     data1   1
  9    333     data2   2
  </code></pre>
  
  <p>can I do this with a simple query?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The example above is just an example. This is my real table on the database :</p>
  
  <pre><code>CREATE TABLE `items` (
    `id` int(11) unsigned NOT NULL auto_increment,
    `trackid` varchar(255) NOT NULL,
    `side` varchar(255) NOT NULL,
    `side_pos` char(2) NOT NULL default '#',
    `pos` int(11) NOT NULL,
    `hh` char(2) NOT NULL,
    `mm` char(2) NOT NULL,
    `ss` char(2) NOT NULL,
    `atl` text NOT NULL,
    PRIMARY KEY  (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=20229 DEFAULT CHARSET=utf8
  </code></pre>