I've been migrating tests away from fragile ", table, table, table, table" idiom by using table aliases in the queries like T in:

"select T.ID, MIN(T.ID) from %s T group by T.ID order by T.ID limit 4"