Hopefully your CILS table is not too many rows...
select * from JOB, CILS as cyan, CILS as magenta where cyan.num_of = JOB.num_of and magenta.num_of = cyan.num_of and cyan.color = 'cyan' and magenta.color = 'magenta' or something not unlike that... You may want UNIQUE JOB.id_enc or somesuch, because this will get TWO JOBs each, since one is cyan and one is magenta. If any of these tables are "large" this could be an enormous number of temp records. Do an "explain" on the query to see just what sort of pain you are looking at... -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=arch...@jab.org