I have a table called Employee with a field called address. I need to write a select that will retrieve all those rows from the table that whose address has a string or part of the string being passed.
So for instance, the address being passed to the query is "7745 Rutherford Rd, Jacksontown County". But the address field has records with only Jacksontown County. Not the entire one mentioned above and I need these rows to be retrieved too.
I tried using the LIKE operator but that will not work I think as the string being passed is longer than what we have in the database. Is there a better way to write this query?
Query:
SELECT *
FROM Employee
WHERE address LIKE '%7745 Rutherford Rd,Jacksontown County%'