Can someone please help me understand the below query, I am fairly new to SQL.
SELECT Count(*) FROM tblservicesubroutes ts
INNER JOIN tblservicelegs sl ON sl.serviceid = ts.serviceid
AND sl.fromcityid = ts.fromcityid AND sl.tocityid = ts.tocityid
This query finds the number of rows in the resultant table obtained after joining two tables
tblservicelegs based on three columns common to both tables, which are
In simple terms it finds the number of rows from both tables where there is a match between the columns specified after ON.