I whant to do something like this:
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
But this gives 0 in the NumberOfRequests and i think it is becouse its hardcoded s.station_id its running LIKE on.
Does anyone know how i can do this?
For your information, r.requested is a string whit some data in it and one example is
/StationInfo – stationID = “262” – Status = 0
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
First approach:
be careful with this non equijoin.
see you.