I'm trying to select pipes with specific codes. These codes are 8 digits long and I only need to select certain combinations. For example, pipes that have codes with the number 8 in the 7th position of the code need to be selected, meaning that a pipe with a code such as 02004580 would be selected. In total there are 4 different cases of codes that would require selection.
I don't know much about SQL but I tried to use the SelectLayerByAttribute tool and then input a query that would select pipes with codes that had an 8 in the 7th position but it did not work:
SELECT*FROM w_pipe WHERE:
SELECT SUBSTRING(CRITICAL_CODE,7,1) =8
The "SELECT*FROM w_pipe WHERE:" is what comes up automatically in the Select by Attributes window. I have a feeling the SelectLayerByAttribute tool might not support the SQL statement that I entered but I'm thinking I just didn't input the proper code.