Learn and explore this.
there are lots of references in forum so search it: Set_query problem! - #2 by NCP