Ziki, that isn't v1.07, make sure you re-downloaded it, extracted it etc.
This is the SQL in 1.07, you have the bold bit missing (as in v1.06).
Code:
SELECT COUNT(post.dateline) AS postcount
FROM ".TABLE_PREFIX."post AS post
LEFT JOIN ".TABLE_PREFIX."thread AS thread ON post.threadid = thread.threadid
Same applies to you tei727 - that sql is not from the current version.