title: MySQL SELECT INNER JOIN and LIKE
body: <p>I whant to do something like this:</p>
  
  <pre><code>SELECT
      s.name,
      COUNT(r.request_log_id) AS NumberOfRequests
  FROM
      station AS s
  LEFT JOIN request_log AS r ON r.requested LIKE '%s.station_id%'
  GROUP BY 1
  </code></pre>
  
  <p>But this gives 0 in the NumberOfRequests and i think it is becouse its hardcoded s.station_id its running LIKE on.</p>
  
  <p>Does anyone know how i can do this?</p>
  
  <p>For your information, r.requested is a string whit some data in it and one example is </p>
  
  <blockquote>
    <p>/StationInfo - stationID = "262" - Status = 0</p>
  </blockquote>
  
  <p>So it is the staitonid i whant to get LIKE on and cound how many rows in request_log table it is in that have the station id for the first table named station</p>