I have a table (Threads) containing a field (id). I would like to select every row from Threads, as well as the number of rows in the
Threads
id
Sure - something like this?
SELECT t.ThreadID, (SELECT COUNT(*) FROM dbo.Posts p WHERE p.ThreadID = t.ThreadID) FROM dbo.Threads t