Jump to content


Photo

is this possible?


  • Please log in to reply
1 reply to this topic

#1 Gaia

Gaia
  • Members
  • PipPipPip
  • Advanced Member
  • 95 posts
  • LocationCanada

Posted 07 October 2005 - 10:33 PM

[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']SELECT[/span] COUNT(*) FROM ibf_members, ibf_posts
[!--sql2--][/div][!--sql3--]

??

And if it is, how do i get each COUNT(*) result seperatly?

So that i can have:

members: xx
posts: xx

Right now it has just counted both those tables and added them together.

#2 Katherine

Katherine
  • Members
  • Pip
  • Newbie
  • 3 posts

Posted 08 October 2005 - 03:55 AM

One way is to use a subquery...
Select 
count(*) as ibf_members_count,
(select count(*) from  ibf_posts ) as  ibf_posts_count
From
ibf_members






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users