Reputation: 442
Basically I have two tables,
Now I want to add a exhaustive search function. which will take both the fields of groups table and property_type table. Any help with the SQL query?
I am using mysql
Upvotes: 0
Views: 41
Reputation: 2848
SELECT *
FROM Group_property_type GPT
JOIN Groups G
ON GPT.group_id = G.group_id
JOIN PropertyType PT
ON GPT.property_type_id = PT.property_type_id
WHERE G.location LIKE '%' + @searchstring + '%'
OR G.city LIKE '%' + @searchstring + '%'
OR ...
Upvotes: 1