mysql - Filtering keyword from second table -


i have 2 tables

employees

id    employee_name  jobtitle      --------------------------- 1     john            ceo  2     ely             manager     3     marcus          manager     4     steve           ceo  5     fritz           assistant    6     orly            analyst 7     carlo           analyst       7     lee             manager 

jobtitle filter

filter_id     jobtitle_keyword      --------------------------- 1               ceo  2               manager   

is posible use jobtitle_keyword filtering keyword?
if run query... result this.

id    employee_name  jobtitle      --------------------------- 1     john            ceo  2     ely             manager     3     marcus          manager     4     steve           ceo       7     lee             manager 

yes, can in mysql using join.

select t1.*    employees t1  join   jobtitlefilter t2  on     t1.jobtitle = t2.jobtitle_keyword 

check working in this sql fiddle.


Comments