title: SQLAlchemy: SQL Expression with multiple where conditions
body: <p>I'm having difficulties writing what should be a simple SQL update statement in SQLAlchemy Core.  However, I can't find any documentation, examples or tutorials that show how to combine multiple where conditions.  I'm sure it's there - just can't find it.</p>
  
  <p>Here's the table:</p>
  
  <pre><code>self.struct    = Table('struct',
                       metadata,
                       Column('schema_name',         String(40),  nullable=False,
                                                                  primary_key=True),
                       Column('struct_name',         String(40),  nullable=False,
                                                                  primary_key=True),
                       Column('field_type',          String(10),  nullable=True),
                       Column('field_len',           Integer,     nullable=True) )
  </code></pre>
  
  <p>Here's the insert &amp; update statement:</p>
  
  <pre><code>def struct_put(self, **kv):
     try:
         i = self.struct.insert()
         result = i.execute(**kv)
     except exc.IntegrityError:   # row already exists - update it:
         u = self.struct.update().\
             where((self.struct.c.struct_name==kv['struct_name']
                    and self.struct.c.schema_name==kv['schema_name'])).\
             values(field_len=kv['field_len'],
                    field_type=kv['field_type'])
         result = u.execute()
  </code></pre>
  
  <p>The code handles the insert fine, but updates all rows in the table.  Can you help me understand the syntax of this where clause?   All suggestions are welcome - thanks in advance.</p>
  
  <p>EDIT:  The corrected clause looks like this:</p>
  
  <pre><code>        where((and_(self.struct.c.parent_struct_name==kv['parent_struct_name'],
                      self.struct.c.struct_name==kv['struct_name'],
                      self.struct.c.schema_name==kv['schema_name']))).\
  </code></pre>
  
  <p>It's a very simple syntax, but given the many layers of SQLAlchemy it was surprisingly difficult to determine what exactly applied within this context.</p>