MySQL Forums
Forum List  »  Newbie

Analyse from count using multiple tables
Posted by: Rafael Narezzi
Date: September 02, 2010 06:54AM

hello guys,

I m quite having a difficult time trying to figure out how to bring me the other tables togther using the count with multiples table

here is my query

select Report_UserDetails_Id, Report_Source,
count(Report_Source) as total
from Report
where Report_Source IN ('1','2') and Report_UserDetails_Id='27'
GROUP BY Report_Source
ORDER BY Report_Source;

So is working fine and will return for me the value's
id = 27 Report_Source=1 Total =82
id = 27 Report_Source=2 Total=23

So far so good now is my trick question

How can I combine with the table Podcast(that have the same value)
select Podcast_UserDetails_Id, Podcast_Source,
count(Podcast_Source) as total
from Podcast
where Podcast_Source IN ('1','2') and Podcast_UserDetails_Id='27'
GROUP BY Podcast_Source
ORDER BY Podcast_Source;

also working fine my question is how could I combine this two queries to bring me over

id = 27 Report_Source=1 Total =82 total_podcast=10
id = 27 Report_Source=2 Total=23 total_podcast=5

Thanks for your help

Options: ReplyQuote

Written By
Analyse from count using multiple tables
September 02, 2010 06:54AM

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.