• Many thanks, this is much cleaner than my previous code.

    I did add

    AND INDEX_ID = 0

    to the WHERE clause to keep my name list unique and not show indexes. I mainly needed the table info.