0

Under a column named "name" I have a row which holds the value "Joe".

What can I use so when I search "Joe Bloggs" it will return the row that only holds "Joe"?

0

2 Answers 2

2

You could do this:

SELECT *
FROM   mytable
WHERE  INSTR(:value, name) > 0

Where :value should be the parameter you will bind to that SQL statement.

Sign up to request clarification or add additional context in comments.

Comments

0

You can also use LIKE:

select *
from t
where $value like concat('%', name, '%');

If you want the name "Joe" only at the beginning:

select *
from t
where $value like concat(name, '%');

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.