MySQL Forums
Forum List  »  Newbie

Count from 3 diffrent tables
Posted by: Adrian Cristian
Date: July 19, 2005 07:12AM

I have 3 tables..

First has the following structure:

id
name

the second one:
id
site_afis #it stores link to first table..must be more then one link to table1

the third one:
id
site_afis #it stores link to first table..must be more then one link to table1


select c1.id, c1.name, count(c2.id), count(c3.id) from table1 as c1, table2 as c2, table3 as c3 where c2.site_afis=c1.id and c3.site_afis=c1.id group by c2.site_afis, c3.site_afis

Options: ReplyQuote


Subject
Written By
Posted
Count from 3 diffrent tables
July 19, 2005 07:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.