I need to query a table column and retrieve all characters left of the string, 'ECSO'. Some of the fields don't contain it though. If it doesn't occur, I will just return whatever is there. I imagine some combination of LEFT and/or CHARINDEX is the solution.
The table is intel_request, and the column is reqofficer. Sample data looks like this:
SMITH, JOHNECSO9999 DOE, JOHNECSO1029 OTHER THOMAS, FRANKECSO1092