All pastes #615277 Raw Edit

Mine

public text v1 · immutable
·published 2007-07-12 01:19 UTC
rendered paste body
SELECT mak.id, mak.name, mak.type, mak.user AS poster, mak.rating, mak.votes, comments.date, COALESCE(c2.amount,0) amount, comments.user FROM mak LEFT JOIN comments ON mak.id = comments.about LEFT JOIN ( SELECT about, MAX( id ) AS latest, COUNT(*) AS amount FROM comments WHERE comment NOT LIKE '%%' GROUP BY about) AS c2 ON comments.id = c2.latest WHERE mak.type='familiar' GROUP BY mak.id ORDER BY comments.date DESC;