Trying to learn how to use Select_analysis
but the queries cause the
ERROR 000358: Invalid expression.
Piece of code:
arcpy.Select_analysis(in_features='test1',
out_feature_class=os.path.join(r'C:\Users\users\Desktop\05\Project1.gdb',
'WACDE'),where_clause="Select test1.KA FROM test1 WHERE test1.NUM = '12'")
What is the correct form?
where_clause
parameter accepts only a WHERE clause (with or without the WHERE). There are a number of examples of correctSelect_analysis
usage in the documentation.arcpy.ArcSDESQLExecute
, but file database doesn't have a backend SQL engine. You need to parse the SELECT statement elements and drop them into their respective parameters.