Reputation: 151
Error SQL query: Documentation
SELECT *
FROM tbl_vehicle_details
INNER JOIN tbl_user, tbl_ride
ON `tbl_vehicle_details`.`v_u_id` = `tbl_user`.`u_id` AND
`tbl_ride`.`r_v_id` =`tbl_vehicle_details`.`v_id`
LIMIT 0, 25
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ON
tbl_vehicle_details
.v_u_id
=tbl_user
.u_id
ANDtbl_ride
.r_v_id
= ' at line 1
Upvotes: 1
Views: 903
Reputation: 72225
You are mixing implicit with explicit join syntax. Try this instead:
SELECT *
FROM tbl_vehicle_details
INNER JOIN tbl_user
ON `tbl_vehicle_details`.`v_u_id` = `tbl_user`.`u_id`
INNER JOIN tbl_ride
ON `tbl_ride`.`r_v_id` =`tbl_vehicle_details`.`v_id`
LIMIT 0, 25
Note: Usage of LIMIT
without an ORDER BY
clause results in an arbitrary selection of records as there is no inherent order in an SQL table.
Upvotes: 5