How do I select all records except the first 5 records with the highest rank number

I have 4 fields in my table (picture_contests).

1. record_ID
2. rank
3. picture_file
4. title

I would like to pull all records except the first 5 records that are ranked the highest.  The rank value is out of a 100 with 100 being the highest.



Who is Participating?
Dale BurrellConnect With a Mentor DirectorCommented:
select *
from Picture_Contest
where id not in
  select top 5 id from Picture_Contest order by Rank asc

The only problem with this is that its non-deterministic, i.e. if any of the top 5 records share the same rank then it will be selecting them at random and it could change from query to query. Ideally you'd have additional information to ensure that the top 5 records are consistent.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.