Using mysql and like statement match a full word to a query
<p>Given: table 'people', and a string 'bob joe'</p>

<p>Return: 'bob a joe' row, NOT the bobby joel row.</p>

<pre><code>name
'bob a joe'
'ana l lee'
'bobby joel'
</code></pre>

<p>I would like to ONLY return bob joe, NOT bobby joel:</p>

<pre><code>SELECT name FROM people 
WHERE name Like '%bob%'
AND name like '%joe%';
</code></pre>

<p>This code returns both the bob and bobby names. Names in my database are not always first last, they are sometimes last first middle, so 'bob %' does not remedy the problem. It is true that </p>

<pre><code>SELECT name FROM people 
WHERE name LIKE '%bob %' OR name LIKE '% bob%' 
AND name LIKE '%joe %' OR name LIKE '% joe%'
</code></pre>

<p>would solve this problem, but I'm looking for a possibly easier or better solution</p>

<p>Thanks so much
Will</p>