Re: weird kind of join

2004-09-30 Thread Diana Castillo
This is the first one I tried, it works great, thanks - Original Message - From: "Gordon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; "'Diana Castillo'" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, September 29, 20

RE: weird kind of join

2004-09-29 Thread Gordon
; SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2); -> 'mysql.com' This function is multi-byte safe. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 29, 2004 12:35 PM To: Diana Castillo Cc: [EMAIL PROTECTED

Re: weird kind of join

2004-09-29 Thread SGreen
try this (not tested): FROM table_a INNER JOIN table_b ON table_b.code LIKE concat(table_a.code,';%') or this: FROM table_a INNER JOIN table_b ON table_b.code RLIKE concat('^',table_a.code,';') http://dev.mysql.com/doc/mysql/en/String_comparison_functions.html http://dev.mysql.

weird kind of join

2004-09-29 Thread Diana Castillo
is there anyway to do a joint between a table that has codes like this 10004;XXX or DE;YYY with a table that has just the first part e.g 10004 or DE as the code There is no set length to the code , all I know is that it is the part before the semicolon. so, I can't say FROM table_a INNER JOIN