I have a table with 2 attributes: Position# and Course#. Currently there are 42 positions (1-42). I need a query to show the course# if that course # appears for all the positions (1-42).
I'm sure there is another way to do this but the first thing that pops into my mind is just to see if there are 42 distinct position#s for each course#
SELECT DISTINCTROW Table1.[course#]
FROM Table1
WHERE ((((select count(*)+1 as ct from table1 as q1 where q1.[position#] > table1.[position#] and q1.[course#] = table1.[course#]))=42));
count(*)=1 adds 1 because position#1 would not get counted
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.