Hi

I need to look in a field to find the text same as another field I have this at the moment but it does not work, hoep you can help

update TAB1, TAB2 set `field3` =`field4` where FIND_IN_SET('`FIELD1`', '`FIELD2`')

I feel FIND_IN_SET is not the right thing as the 2 fields may be

field1 - blue car
field2 - blue car bits

Thanks

Member Avatar for diafol

LIKE may be a better option in that case

SELECT * FROM table WHERE field2 LIKE CONCAT('%',field1,'%')

Great thanks that worked perfect.

Thanks Again

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.