>>. Firstly, I want to restrict the number of maxrows returned
Ideally that's something that should be done at the db level. It could also be done in CF code. But there's no point incurring the overhead of pulling back data that won't be used.
You could probably use a derived table to limit the results in SQL. In other words, select the TOP 10 updates first, then JOIN to the other tables. The exact syntax and structure is database dependent. MS SQL use TOP, MySQL uses LIMIT, etc....
Also, any "top x" records scenario involves ordering the records by "some column". I'm assuming you want the latest 10 updates...? Some databases restrict what operations you can perform in a derived table. So it's very likely your actual sql will need tweaking...
<!---
Not tested. Psuedo SQL ....
--->
SELECT s.sID, s.wUserID, s.sStatus, .....Other Columns ...
FROM <!--- this is a derived table to grab the latest 10 updates .....--->
(
SELECT TOP 10 sID, wUserID, sStatus, ......OtherColumns....
FROM statusupdates
ORDER BY sCreatedDate DESC
) s
LEFT JOIN users u ON s.wUserID=u.wUserID
LEFT JOIN comments c ON c.inreplyto = s.sID
LEFT JOIN users cu ON c.wUserID=cu.wUserID
ORDER BY s.sCreatedDate DESC, s.sID
>> Secondly, I'd like to add a 'count' for the number of comments for each status.
Do you want to display the count before OR after the comments. If you want to display it after the comments, then using a cfset within the loop is fine. If you need to display it _before_ the comments, then obviously you'll need to know the totals ahead of time.