title: Is it safe to compare strings with 'greater than' and 'less than' in MySQL?
body: <p>MySQL (5.1.41-3ubuntu12.10-log) seems to give predictable results on string comparison using > (greater than) and &lt; (less than):</p>
  
  <pre><code>select "a" &gt; "a", "a" &gt; "b", "b" &gt; "a", "ab" &gt; "aa", "ab" &gt; "aabbbb";
  +-----------+-----------+-----------+-------------+-----------------+
  | "a" &gt; "a" | "a" &gt; "b" | "b" &gt; "a" | "ab" &gt; "aa" | "ab" &gt; "aabbbb" |
  +-----------+-----------+-----------+-------------+-----------------+
  |         0 |         0 |         1 |           1 |               1 | 
  +-----------+-----------+-----------+-------------+-----------------+
  </code></pre>
  
  <p>and also seems to make use of keys:</p>
  
  <pre><code>explain select productcode from products where productcode &lt; 'no'; 
  +----+-------------+----------+-------+-----------------+------+---------+------+------+--------------------------+
  | id | select_type | table    | type  | possible_keys   | key  | key_len | ref  | rows | Extra                    |
  +----+-------------+----------+-------+-----------------+------+---------+------+------+--------------------------+
  |  1 | SIMPLE      | products | range | productcode,ppp | ppp  | 34      | NULL |  432 | Using where; Using index |
  +----+-------------+----------+-------+-----------------+------+---------+------+------+--------------------------+
  </code></pre>
  
  <p>This doesn't seem to be documented - is it a dependable cross-platform feature?</p>