Edit sql WHERE clause to filtering with instance name.