On Thu, Apr 3, 2014 at 6:32 PM, Roman Fleysher <
roman.fleys...@einstein.yu.edu> wrote:

> Dear SQLiters,
>
> Could some help if this is bad design or my lack of knowledge of SQL:
>
> I have a table that keeps track of bad metrics from exams:
>
> badMetric(examID, metric, reason)
>
> I want to filter-out bad ones and keep only good ones from the user
> request:
>
> request(examID, metric).
>


SELECT eximID, metric FROM request
EXCEPT SELECT eximID, metric FROM badMetric;


>
> I thought:
>
> SELECT request.examID, request.metric FROM request, badMetric
> WHERE NOT (request.examID = badMetric.examID AND request.metric =
> badMetric.metric)
>
> This produces empty list. Is it because the badMetric is actually empty
> and "FROM request, badMetric" produces cross product of not-empty with
> empty tables which is an empty table?
>
> Is this a bad design and I should add a quality column:
>
> badMetric(examID, metric, reason, quality)
>
> What could be other solutions?
>
> Thank you,
>
>
> Roman
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to