I want to search a data in to a table
My table structure is Table : tbl_clientinfo_dplist
dplist_id dp_id dplist
-------------------------------
1 1 aaa
2 1 bbb
3 1 ccc
4 1 ddd
5 2 eee
6 2 fff
7 2 ggg
My Another table structure is Table : tbl_client
client_id provider_type group_name cmp_legal_name
---------------------------------------------------------------
1 1 5 Test1
2 2 6 Test2
3 3 7 Test3
4 1 5 Test4
5 4 6 Test5
dp_id=1 are provider type and dp_id=2 are group name.
how can I search provider type or group name from table?
Here it is my current query
SELECT *
FROM tbl_client
LEFT JOIN tbl_clientinfo_dplist
ON (tbl_client.provider_type = tbl_clientinfo_dplist.dplist_id)
OR (tbl_client.group_name = tbl_clientinfo_dplist.dplist_id)