From: Jan Peuker Date: April 29 2002 6:36pm Subject: Re: What is the best way to do this List-Archive: http://lists.mysql.com/mysql/107516 Message-Id: <00dd01c1efac$c83870c0$7164a8c0@toshiba> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit yep, that's the problem. But MySQL wouldn't do anything else, just a bit faster because there are no queries to "compile". The only problem is, i don't know how to split this field into single values. If this would be possible, you could fill another table3 w/ these values enclosed by % % as patterns and do this: select row from table2,table3 where fields-m like table3.patterns; This should work, regards Jan ----- Original Message ----- From: "Javier" To: "Jan Peuker" Sent: Monday, April 29, 2002 7:48 PM Subject: Re: What is the best way to do this > Thanks, this should work, but I'm worry about the speed, because, both > tables are very big. Maybe exists some possibility to do this using > temporary tables and mysql variables, what do you think? > > Thanks > > Javier > > ----- Original Message ----- > From: Jan Peuker > To: Javier > Sent: Monday, April 29, 2002 6:23 PM > Subject: Re: What is the best way to do this > > > > My (dumy-newbie) opinion is, that this task would be too hard for mysql. > > Better do this in your program, e.g. first do a select on table1 and > create > > an array out of the results(split the line and trim the values), then do a > > while/for with "select row from table2 where field-m like '%arrayfield%'" > > (for sure, replace arrayfield). > > regards, > > > > Jan > > > > ----- Original Message ----- > > From: "Javier" > > To: > > Sent: Monday, April 29, 2002 6:52 PM > > Subject: What is the best way to do this > > > > > > > > > > Hi everybody, > > > > > > I need do the following: > > > > > > I have two MySQL tables, > > > > > > Table1 > > > . > > > . > > > field-n > > > . > > > . > > > > > > Table2 > > > . > > > . > > > field-m > > > . > > > . > > > > > > and are both varchar(100) containing words > separated > > by > > > space. I need to find out if any of the words in also are in > > > . > > > > > > Is it possible to do that? What is the best way for it? > > > > > > Thanks > > > > > > Javier Diaz > > > IT Developer > > > > > > > > > > > > - Scanned for all known viruses by Messagelabs -- > > > > > > --------------------------------------------------------------------- > > > Before posting, please check: > > > http://www.mysql.com/manual.php (the manual) > > > http://lists.mysql.com/ (the list archive) > > > > > > To request this thread, e-mail > > > To unsubscribe, e-mail > > > > > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > > > > > > > - Scanned for all known viruses by Messagelabs -- > > > - Scanned for all known viruses by Messagelabs --