Copy link to clipboard
Copied
Hi,
I have three tables:
1) a table (WEBSITES) where I store the "urls" of websites I want to evaluate.
2) a table (EVALUATIONS) where I store "evalutations" (this website is good, this is bad ...) of each website.
3) a table (EVALUATORS) where I store the "evaluators".
I want to create a query that pick the first website's url that the evaluator X has not evaluate yet.
To semplificate use these tables and fields:
WEBSITES
id | url
EVALUATORS
id | evaluator
EVALUATIONS
id | idwebsite | idevaluator
Could you build for me a query that work? I tried but I'm not so good as I thought ...
Thanks in advance for you help.
GiBi
Copy link to clipboard
Copied
SELECT MIN(ID), URL
FROM WEBSITES
WHERE ID NOT IN (SELECT IDWEBSITE FROM EVALUTATIONS WHERE IDEVALUATOR = 13)
GROUP BY ID, URL
Is that close?
Copy link to clipboard
Copied
Yes, very close, thanks a lot.
I was able to work it out with this query:
SELECT TOP 1 ID
FROM WEBSITES
WHERE ID NOT IN (SELECT ID FROM EVALUATIONS WHERE IDEVALUATORS = 1)
Copy link to clipboard
Copied
This
EVALUATIONS
id | idwebsite | idevaluator
looks incomplete. Where is the field with the evaluation?
Copy link to clipboard
Copied
I presumed it was left out of the post from this line.
To semplificate use these tables and fields:
Copy link to clipboard
Copied
Exactly.