Method LastTopLevelIndexOf(string, string, int)
The position of the last keyword at or after start that belongs to the
statement itself: outside every parenthesis and every quoted literal or identifier. -1 when there is none.
A keyword inside a subquery, a CTE body or an aggregate (array_agg(x ORDER BY i),
WITHIN GROUP (ORDER BY i)) is not the statement's.
public static int LastTopLevelIndexOf(string sql, string keyword, int start = 0)