
November 18th, 2003, 01:26 AM
|
|
Junior Member
|
|
Join Date: Nov 2003
Location: Australia
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
SQL COUNT from mutiple tables
I have a problem, I am building a forum where people create a topic/discussion this is assigned an id, then under this id they are able to post replies. My problem is I need to be able to display the total count of replies on the replies page .
I currently have
"SELECT * FROM (SELECT *, (SELECT COUNT (*) FROM REPLIES WHERE REP_MESSAGE = MSG_ID) AS REP_COUNT FROM MESSAGES, REPLIES)" this is listing the COUNT but for all the replies not one specific. There is a field called MSG_SUBJECT in the MESSAGES table that I want to link to this COUNT statement so I can show the COUNT for each specific topic not all topics can anyone help?
|