Re: stuck on a query

2008-12-18 Thread mv
Now that was fun and educational. :-) I like the third approach, but theres an added problem to the whole thing. This query is just a part of a bigger search. The tables, job and color and other fields, which will also be searchable. I am trying to automate the whole process, i mean, the user see

Re: stuck on a query

2008-12-17 Thread Gavin Towey
Three solutions, the first one is not recommended I just showed it for fun -- I think the last one is the most efficient: mysql> show create table job \G *** 1. row *** Table: job Create Table: CREATE TABLE `job` ( `job_id` int(10) unsigned

Re: stuck on a query

2008-12-17 Thread mv
Sorry i replied from a different address. Heres the reply with some editing: Got it to work perfectly, thanks, although it takes some time (CILS has >150.000 records). There was no need for unique since all the results are already surprisingly unique. Thank you, it was a different way of doing th

Re: stuck on a query

2008-12-17 Thread Miguel Vaz
Got it to work perfectly, thanks, although it takes some time (CILS has >150.000 records). There was no need for unique since all the results are already surprisingly unique. Thank you, it was a different way of doing things. Well, different to me, at least. :-) In the meantime, i found an altern

Re: stuck on a query

2008-12-17 Thread ceo
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

stuck on a query

2008-12-17 Thread mv
Hi, I am trying to solve a problem that i have been stuck for a few days, i hope you guys can shed some light on this. I have two tables: enc and cils JOB: id_enc num_of name CILS: id_cil num_of color each "JOB" is composed of severals "CILS" (i know i should link tables using id_enc, but for