Mysql Query With Inner Join Returning Zero Rows
SELECT * FROM Posts WHERE MATCH (Posts.City) AGAINST ('Lujan') Shows 29 rows. But: SELECT Users.*, Posts.* FROM Users INNER JOIN Posts ON Users.User = Posts.User WHERE MATCH (
Solution 1:
It means that there is no row in the Users table which match with the Posts table. If you want to select the rows even if there is no match, use an external join (change the INNER JOIN with a RIGHT JOIN in your case).
Solution 2:
Does this return your rows? It's possible there's no corresponding user entry in the Users table for your Posts records.
SELECT*FROM Posts
LEFTJOIN Users ON Users.User = Posts.User
WHEREMATCH (Posts.City) AGAINST ('Lujan')
Post a Comment for "Mysql Query With Inner Join Returning Zero Rows"