title: How to catch text from string in mysql?
body: <p>Here, Im trying to get the middle value (<strong>log in</strong>) of the string in <strong>Comment column</strong> and then get the count for each user. but I think this is not the right way to do. Is there any other way you guys have...!</p>
  
  <pre><code>user#   user ID Comments
  101     user 1  ***log in*** : shera
  101     user 1  ***log in*** : Mark
  102     user 2  ***log out***
  105     user 5  ***log in*** : Mark
  104     user 4  ***ideal***
  103     user 3  ***ideal***
  101     user 1  ***ideal***
  102     user 2  ***log out*** : since 5 mnt
  105     user 5  ***log in*** : Mark
  104     user 4  ***ideal***
  103     user 3  ***log out***
  </code></pre>
  
  <p>query need to be design for:</p>
  
  <pre><code>         log in ideal   log out
  user 1    2       0        3
  user 2    0       2        5
  user 5    0       2        1
            ------------------
  Total      2      4        9
  </code></pre>
  
  <p>Thanks for consideration.
  Jay</p>