Not all child
rows have a parent
. The child
rows that have a parent
should only be fetched if parent.deleted='0'
If LEFT JOIN content as parent
doesn't exist, how do i ignore parent.deleted='0'
for that row?
SELECT child.* FROM `content` child LEFT JOIN
content parent on parent.id=child.parentid AND child.submittype='2' WHERE child.username=?
AND child.deleted='0' AND parent.deleted='0'
ORDER BY child.id DESC LIMIT 12
How do i do this? I put parent.deleted='0'
in the WHERE CLAUSE but this would only work if parent
row existed.