MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 6th, 2004, 12:41 PM
mns76 mns76 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 8 mns76 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 31 sec
Reputation Power: 0
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!

Reply With Quote
  #2  
Old August 6th, 2004, 01:42 PM
swampBoogie swampBoogie is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2003
Location: Paris Uppland
Posts: 1,784 swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 21 h 42 m 49 sec
Reputation Power: 37
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > need sql query help


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT