•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 374,023 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,844 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser:
Views: 778 | Replies: 3
![]() |
•
•
Join Date: Jul 2006
Posts: 46
Reputation:
Rep Power: 3
Solved Threads: 0
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.
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.
•
•
Join Date: Jul 2006
Posts: 46
Reputation:
Rep Power: 3
Solved Threads: 0
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 LEFTJOIN peerReviewQuality AS Qplanning ON peerReview.planning = Qplanning.qualityID LEFTJOIN peerReviewQuality AS Qdecision ON peerReview.decision = Qdecision.qualityID LEFTJOIN peerReviewQuality AS QtimeManage ON peerReview.timeManage = QtimeManage.qualityID LEFTJOIN peerReviewQuality AS Qproblem ON peerReview.problem = Qproblem.qualityID LEFTJOIN peerReviewQuality AS Qtechnical ON peerReview.technical = Qtechnical.qualityID LEFTJOIN peerReviewQuality AS Qflexibility ON peerReview.flexibility = Qflexibility.qualityID LEFTJOIN peerReviewQuality AS Qmotivation ON peerReview.motivation = Qmotivation.qualityID LEFTJOIN peerReviewQuality AS Qreliability ON peerReview.reliability = Qreliability.qualityID LEFTJOIN peerReviewQuality AS Qteamwork ON peerReview.teamwork = Qteamwork.qualityID LEFTJOIN peerReviewQuality AS QwrittenComm ON peerReview.writtenComm = QwrittenComm.qualityID LEFTJOIN peerReviewQuality AS QoralComm ON peerReview.oralComm = QoralComm.qualityID LEFTJOIN peerReviewQuality AS QresultsContributes ON peerReview.resultsContributes = QresultsContributes.qualityID
Last edited by ChimpusDupus : Jun 22nd, 2007 at 9:47 am.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb MS SQL Marketplace
- Help with a seemingly simple program (C++)
- vBulletin mod_rewrite (PHP)
- Problems With Xp Boot Loader (Windows NT / 2000 / XP / 2003)
- Need help writing a program (C++)
- have you ever abused ur powers? (Geeks' Lounge)
- Mac Mouse Problem! Help me out? (OS X)
Other Threads in the MS SQL Forum
- Previous Thread: Database Query Help
- Next Thread: insert multiple rows in database


Linear Mode