title: Can someone explain me which queries I need for a nice search in SQL?
body: <p>I asked for a single query in <a href="https://stackoverflow.com/questions/8095864/sql-with-multiple-likes-over-1-variable">my previous question</a> but now I want to ask about multiple queries. </p>
  
  <p>I'm making a search engine that searches through some specific tables. </p>
  
  <p>When the input is "<strong>testone testtwo testthree</strong>" I will need to do a lot of queries. </p>
  
  <ol>
  <li>a search with the complete string</li>
  <li>a search with the 3 words in 3 strings ( if they can be seperately found in one item)</li>
  <li>a search with 2 words in a combined string</li>
  <li>a search with 2 words in 2 strings</li>
  <li>a search with all words apart</li>
  </ol>
  
  <p>As you know this decides what is a more important result. </p>
  
  <p>I am building the queries seperately for all the 5 searches above as well as seperate for each table because a result from one table can be more important than from the other.</p>
  
  <p>I made the queries like this: </p>
  
  <pre><code>SELECT *
  FROM company_address
  WHERE address_street LIKE '%test%'
  OR address_zipcode LIKE '%test%'
  OR address_telephone LIKE '%test%'"
  OR address_fax LIKE '%test%'
  OR address_website LIKE '%test%'
  </code></pre>
  
  <p>I know this is not the best way to do it, and because you guys are much better than me with this i would love some advice!</p>