title: Using "like" in a cursor/query with a parameter in python (django)
body: <p>I know this may be something stupid but I decided to ask any way.</p>
  
  <p>I've been trying to query something like:</p>
  
  <pre><code> cursor.execute("select col1, col2   \
                      from my_tablem \
                      where afield like '%%s%'
                      and secondfield = %s
                      order by 1 desc " % (var1, var2) )
  </code></pre>
  
  <p>But I get an error in the like sentence. It doesn't like the extra % which I need to get all the results that contains the first %s value.</p>
  
  <p>Ideas?</p>
  
  <p>TIA! </p>