Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help finding part of one field in another 1

Status
Not open for further replies.

anabavi

MIS
Oct 27, 1999
20
US
I want to find/delete the contents of a field, Address6, if it contains (not necessarily exclusively) the contents of the City field. I can't figure out how to do this. I've tried things like:

select address6, city from table where city in(address6)
. . . but that only shows exact content matches

select address6, city from table where address = '%'city'%'

select address6, city from table where address = concat('%',city,'%')

. . . and variations on those. I'm trying to do it without using PHP, just MySQL. Is there a way to do this entirely within MySQL?

Thanks a lot,


Ali
 
Yippee! Cookin' with gas, now!

Thank you so much, that worked perfectly.

By the way, I'm reading "How To Ask Questions The Smart Way" right now. Hopefully I didn't start reading it too late. :) I'm thinking about putting a link to it on our corporate site because it is so enlightening.

Thanks again,


Ali
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top