![]() |
| ||
| Seemingly Simple Issue Hi, I created to data tables to hold information provided through peer reviews in the company that I work for. One table has 5 different levels of quality (unsatisfactory, meets some requirements, meets requirements, exceeds expectations greatly exceeds expectations), and another table that holds the data for each peer review (the person who is being reviewed, the time, comments, and a number to be used as a key into the quality table for each criteria). For example, one row might read: userID = 1, Planning=5 (greatly exceeds expectations), Decision Making = 3, Time Management =2, Comments = 'So-and-so has problems with...', time/date =June 20, 2007, 10:18. The problem is, because there are numerous criteria for each peer review, I cannot figure out how to select a quality for each criteria. If I do an INNER JOIN ON planning = qualityID and decisionMaking = qualityID... I don't get any data. |
| ||
| Re: Seemingly Simple Issue Hm, I think my first message was probably very unclear. My problem seems to be that I'm working with a one-to-many relationship (I only know how to work with one-to-one relationships). Basically, how do I write a SELECT command for two tables with a one-to-many relationship. |
| ||
| Re: Seemingly Simple Issue 1 Attachment(s) Attatched is the diagram of the relationship. I want to display a report that has a qualityDescription for each of the columns in the peerReview table that are related to the peerReviewQuality table (planning, decision, timeManage, problem, etc.) |
| ||
| Re: Seemingly Simple Issue Looks like I found the answer somewhere else. I just had to use LEFT JOIN to the peerReviewQuality table for each column in the peerReview table: SELECT peerReview.employeeID, Qplanning.qualityDescription, Qdecision.qualityDescription, QtimeManage.qualityDescription, Qproblem.qualityDescription, Qtechnical.qualityDescription, Qflexibility.qualityDescription, Qmotivation.qualityDescription, Qreliability.qualityDescription, Qteamwork.qualityDescription, QwrittenComm.qualityDescription, QoralComm.qualityDescription, QresultsContributes.qualityDescription, peerReview.comments, peerReview.timeDate FROM peerReview |
| All times are GMT -4. The time now is 12:15 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC