asp.net - T-SQL Select and count from different table? -



asp.net - T-SQL Select and count from different table? -

i have table (threads) containing field (id). select every row threads, number of rows in table posts field posts.thread same threads.id.

how can done in sql?

(something pseudo-sql: select *, count(* posts posts.id=threads.id) threads)

select t.id, count(p.thread) threads t left outer bring together posts p on t.id = p.thread grouping t.id

asp.net sql tsql

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -