title: MySQL SELECT with decimal values
body: <p>I'm trying to select a row from <code>MySQL</code> table that contains DECIMAL values.</p>
  
  <p>When I call:</p>
  
  <pre><code>SELECT * FROM some_table WHERE  submit_time='1386163272.2866' LIMIT 1
  </code></pre>
  
  <p>it selects the row properly. But when I try to make this select a little bit more specific:</p>
  
  <pre><code>SELECT * FROM some_table  WHERE  submit_time='1386163272.2866' AND field_name='stan' LIMIT 1
  </code></pre>
  
  <p>it returns no results. </p>
  
  <p>The <code>submit_time</code> field is <code>DECIMAL(16,4)</code> and <code>field_name</code> is <code>VARCHAR</code>. Of course there is a row with that combination of submit_time/field_name values (I checked via phpmyadmin)</p>
  
  <p>Where did I go wrong? </p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>The query:</p>
  
  <pre><code>SELECT * FROM some_table  WHERE  field_name='stan' 
  </code></pre>
  
  <p>also returns a row.</p>
  
  <p>Using <a href="https://stackoverflow.com/a/20386696/177167">Vincent's suggestion</a> following query:</p>
  
  <pre><code>SELECT * FROM some_table  WHERE  submit_time='1386163272.2866' AND field_name LIKE '%stan%' LIMIT 1
  </code></pre>
  
  <p>returned the row that I wanted, but I now want to update some values in this row, so I'm trying following query:</p>
  
  <pre><code>UPDATE some_table SET field_value='1' WHERE  submit_time='1386163272.2866' AND field_name LIKE '%stan%' LIMIT 1
  </code></pre>
  
  <p>but it says "no row affected". </p>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>OK, when I removed the <code>'</code> from <code>WHERE</code> query, it worked:</p>
  
  <pre><code>UPDATE some_table SET field_value='1' WHERE  submit_time=1386163272.2866 AND field_name LIKE '%stan%' LIMIT 1
  </code></pre>