General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 22nd, 2012, 03:42 AM
Doo Doo is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 2 Doo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 27 sec
Reputation Power: 0
Help with query on multiple tables

Hi Folks,
I'm really hoping someone can help me. I'm trying to chart data from two different tables. I'm a noobie at this so any help would be greatly appreciated!

I have two tables:

Table: review
Field: reviewId, reviewForum

Table: mom
Field: reviewId, result.

What I need to extract from these tables are the forum and the result. For example the reviewForum could be A, B, C, D and result will be approved, not approved or cancelled. So what I need to do is extract the reviewForum and the result associated with it which I can do, however, I need to count how many results are associated with the reviewForum. So for A there could be 10 approved, 5 not approved and 2 cancelled.

here is the query I am using

SELECT r.reviewForum, m.result
FROM review r, mom m
WHERE r.reviewId = m.reviewID;

This checks the common field reviewId, if they match, extract. This extracts the reviewForum and result. I need a count of each result...can anyone help me?

something like:

reviewForum
A
B
D

Approved
5
1
8

Not Approved
10
5
6

Cancelled
1
3
9

That's probably not laid out the best way but I hope you understand...
Regards,
Gary

Reply With Quote
  #2  
Old May 22nd, 2012, 09:28 PM
Esther255 Esther255 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 3 Esther255 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 m 2 sec
Reputation Power: 0
Here's what's going on with 'not a valid result resource' errors. Take the following example:URLURLURLURL

Reply With Quote
  #3  
Old May 23rd, 2012, 05:50 AM
Doo Doo is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 2 Doo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 27 sec
Reputation Power: 0
Hi Esther,

I can't see that example...?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > Help with query on multiple tables


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap