AnsweredAssumed Answered

SQL in "Extract by Attributes"  Conditional Where Clause

Question asked by cucurbita on Jul 21, 2014
Latest reply on Aug 5, 2014 by cucurbita

I am trying to apply an SQL-funktion within the "Extract by Attributes"-Tool of ArcGIS.

I have a Table of 27.000 rows and 2+8 columns. I would like to select only those rows, where the event field=1 happens only 3 times in all. Values within those columns are 1, 2, 3 or 4.

The tool already provides the select funktion part, there after:

 

(CASE WHEN "1984" =1 THEN 1 ELSE 0 END
AND CASE WHEN "1986" = 1 THEN 1 ELSE 0 END
AND CASE WHEN "1987" = 1 THEN 1 ELSE 0 END
AND CASE WHEN "1991" =1THEN 1 ELSE 0 END
AND CASE WHEN "2000" =1 THEN 1 ELSE 0 END
AND CASE WHEN "2003" =1 THEN 1 ELSE 0 END
AND CASE WHEN "2006" =1 THEN 1 ELSE 0 END
AND CASE WHEN "2011" =1 THEN ELSE 0 END)
>= 3

 

The SQL statment is not excepted by the ArcGIS-tool. So something must be wrong here.

Greatefull for any ideas!

Outcomes