How to build a SQL expression in Python

Discussion created by jvickrey79 on Oct 5, 2010
In light of ArcGIS Server not recognizing the "Query Builder" wizard when using the Select By Attributes tool, I'm wondering if there is a way to manually construct the Query Builder?  So for instance, (see attached picture) based on the user first selecting which feature layer they want to run query against, a second dropdown list would then show All the Attributes associated with that feature layer.  A third dropdown list would then contain the values from which attribute the user chose.  So for example, If I wanted to run this Query "Active" = 'N' on the Wells layer.  Does anyone have any python to get me started here?

many thanks