I have two tables whose strcuture is as follows
Table name = counter
ref_id INT NOT NULL
count INT NOT NULL
Table name = favs
disqus_id VARCHAR(32) NOT NULL
user_id INT NOT NULL
dormant VAHCHAR(10) NOT NULL
I run this query => SELECT count, dormant FROM counter AS c LEFT JOIN favs AS f ON c.ref_id = f.disqus_id WHERE ref_id = 'post_5' AND user_id = '1'.
But it returns no rows, if a match is not found in the second table favs. What i want is that it should return both the columns if result found, else return both columns with second one being NULL
How do i do this?
the the condition for the user on the
ONclauseor if still doens’t work, move both: