Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
drakull
Starting Member
12 Posts |
Posted - 2001-07-02 : 16:45:31
|
| i'm creating a news page with user comments, in the frontpage i want to list just the news and the number of comments of each news. i tried the query below:SELECT news.id, news.tit, news.thenews, count(*) as newscommentsFROM news left join comments on news.id=news_idGROUP BY news.id, news.tit, news.thenewsORDER BY news.thedate DESCThe only problem here is that if the news doesn't have any comments, the totalcomments still returns 1.thanks in advance!----------Henrique |
|
|
|
|
|