Is @all_id created by another SQL query ?
In reply to Re: SQL Select by poj in thread SQL Select by Scully4Ever