View Single Post
  #1 (permalink)  
Old 11-05-09, 11:05 AM
landing's Avatar
landing landing is offline
Coding Addict
 
Join Date: Jul 2006
Location: Scotland
Posts: 302
Thanks: 0
Thanked 0 Times in 0 Posts
SQL query question

Hi there

I'm trying to establish if the following is possible using SQL on it's own (I know it can be done by means of scripting)

I have the following table

Code:
year (int)
course (string)
rep_id (int)
The table describes "course representitives" in a particular year. I'm trying to find a way to list the rep_id of all reps who have been a rep in 2 consecutive years. I can't for the life of me establish the SQL.

Hope someone can help.


Thanks
__________________
Always sanitise your data


Best regards
Reply With Quote