You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND
f71>0' at line 5
SELECT MIN(f71)
FROM xtree40
LEFT JOIN xtree62
ON(xtree62.content_id = xtree40.content_id)
WHERE f = AND
f71>0