|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
need sql query help
okay, I'm not sure if this is the exact place I need to post this.
I need to explain what I am trying to do. I have a table that holds abstracts written for other ppl to judge. Each judge can login and see each abstract, and start judging. My problem is that I am having a difficult time generating a query that will allow each judge to see all abstracts they judged, and all abstracts they have not judged. I know I need two separate recordsets for this, but the setup is stumping me. So far, I have the following tables created: abstracts - fields: abstractID, abstracttext judges - fields: judgeID, password judgedAbstracts - fields: judgeID, abstractID, score Here is the sql statement I have come up with: SELECT judgedAbstracts.judgeID, abstracts.abstractID, judgedAbstracts.abstractID FROM abstracts INNER JOIN judgedAbstracts ON abstracts.abstractID = judgedAbstracts.abstractID WHERE (((judgedAbstracts.judgeID)=1)); This gets me what is in the judgedAbstracts, but I want to show which abstracts are not yet judged - based on what IS judged from the judgedAbstracts table. As soon as a judge creates a score for an abstract and submits it into the judgedAbstracts table, I need each judge to know which abstracts are left to judge, while being able to see which abstracts are already judged. anybody have any clues on how that is written? thanks! |
|
#2
|
|||
|
|||
|
Code:
SELECT judgedAbstracts.judgeID, abstracts.abstractID FROM abstracts left JOIN judgedAbstracts ON abstracts.abstractID = judgedAbstracts.abstractID and judgedAbstracts.judgeID=1 If the judgedAbstracts.judgeID column is null this means that the abstract have not been judged |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > need sql query help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|