Thanks John,
I have found away to do this.
In AIM I'm building a plaintext list of the required IDs with the following AIM Attribute rule.
StoredProcedure.Attribute_Query='<<LIST_LINE(StoredProcedure.pm_Attribute,``,`,`,`,`,`ID`)>>'
Storing this in calculated attribute (handy for debugging) and it ends up looking like
17083,17085,17088
Then I've found a FIND_IN_SET option in mysql that searches the text list. The mySQL command is now
SELECT * FROM BusinessSpace_PERSON WHERE (Attribute_Query="" OR FIND_IN_SET(ps_Attribute_RID,Attribute_Query));