Hi, I think it's a not bad idea if you "look" at : http://www.mysql.com/doc/S/t/String_functions.html http://www.mysql.com/doc/S/t/String_comparison_functions.html Regards, Gelu _____________________________________________________ G.NET SOFTWARE COMPANY
Permanent e-mail address : [EMAIL PROTECTED] [EMAIL PROTECTED] ----- Original Message ----- From: Jan Peuker <[EMAIL PROTECTED]> To: Javier <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, April 29, 2002 9:36 PM Subject: Re: What is the best way to do this > 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" <[EMAIL PROTECTED]> > To: "Jan Peuker" <[EMAIL PROTECTED]> > 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 <[EMAIL PROTECTED]> > > To: Javier <[EMAIL PROTECTED]> > > 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" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > 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 > > > > . > > > > . > > > > > > > > <field-n> and <field-m> are both varchar(100) containing words > > separated > > > by > > > > space. I need to find out if any of the words in <field-n> also are > in > > > > <field-m>. > > > > > > > > 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 <[EMAIL PROTECTED]> > > > > To unsubscribe, e-mail > > > <[EMAIL PROTECTED]> > > > > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > > > > > > > > > > > > - Scanned for all known viruses by Messagelabs -- > > > > > > - 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 <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > --------------------------------------------------------------------- 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 <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php