title: mysql order by matches in comma separated field
body: <p>I have one blog table which contains different tags,</p>
  
  <p>now i want to order blog by max tag match</p>
  
  <p>and am storing tags comma separated in one field </p>
  
  <p>now how to do that?</p>
  
  <p>I tried <strong>find in set</strong> but still dident get work.</p>
  
  <p>Please suggest me any better way to do so.</p>
  
  <p>table like:</p>
  
  <pre><code>id | title | desc      | tags
  
  1 | test1 | test1 desc | t1,t2,t3,t4
  
  2 | test2 | test desc  | t1,t2
  
  3 | test3 | test desc  | t1,t2,t3
  
  4 | test4 | test desc  | t3,t4
  
  5 | test5 | test desc  | t1,t2,t3,t4
  </code></pre>
  
  <p>here suppose i want closest blog post of <strong>"test1"</strong> post then answer should be 
  <strong>5,3,2,4</strong></p>
  
  <p>first match with tags and after that if same tag count then by id</p>