简体   繁体   中英

search between two tables

I want to search between 2 tables for matching strings.

For eg. I have a Members table ( tblprofile.area_of_specialization ) which contains comma delimited strings like Engineering, Plumber, Technician, etc…)

I also have another table ( tbljobs.area_of_specialization ) which contains comma delimited strings like Engineering, Electrician, Painting, etc…)

Please, how do I search between these tables and match table jobs with those whose their profile qualify for the job?

Thanks

I am not sure this violates normalization guidelines. I am looking at having something like SELECT *** FROM ** WHERE tblprofile.area_of_specialization LIKE tbljobs.jobcriteria. ---this works just that the match is not 100% because of the constraints in using LIKE %'...'%

Why don't you just use a standard JOIN and join both tables if there is common data point?

Details here: http://www.tizag.com/mysqlTutorial/mysqljoins.php

However you DO need to normalize this data, this should only be used as a temporary solution

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM