title: PSQL - How to filter out if a column value equals a specific string
body: <p>I created a database with column called option where the value is a varchar of either 'Call', 'Put', or None. When I set up the database I made the default value None if there was no Call or Put.</p>
  
  <p>I'm trying to filter out the rows that contain 'Call' or 'Put' for option. However, when I write the query</p>
  
  <p>SELECT *
  FROM holdings h
  WHERE h.option != 'Call'
  AND h.option != 'Put';</p>
  
  <pre><code>I get this error:
      curr.execute('SELECT option FROM holdings WHERE option != 'Call';')
                                                                    ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>When I try to use NOT LIKE '%Call%' I get this error:</p>
  
  <pre><code>curr.execute('SELECT option FROM holdings AS h WHERE option NOT LIKE '%Call%';')
  NameError: name 'Call' is not defined
  </code></pre>
  
  <p>Any help would be appreciated</p>
  
  <p>Thanks!</p>
  
  <p>Code looks like this:</p>
  
  <pre><code>import psycopg2
  import csv
  conn = psycopg2.connect('dbname = db user = asmith')
  curr = conn.cursor()
  curr.execute('SELECT option FROM holdings h WHERE option NOT LIKE '%Call%';')
  tups = curr.fetchall()
  for tup in tups:
      print tup
  </code></pre>
  
  <p>Edit:
  When I run these two lines:   </p>
  
  <pre><code>curr.execute('SELECT * FROM holdings h WHERE option = \'Call\' OR option = \'Put\';') 
  curr.execute('SELECT * FROM holdings h WHERE option != \'Call\' AND option != \'Put\';')                                                                                                                                                                                                                                                                                                         
  </code></pre>
  
  <p>The first query gives me all the rows with a Call or Put, but when I run the second query I get nothing, even though it should theoretically give me all of the rows with option that are None. Does anyone know why that is?</p>