Well for 1, this is a 2005+ query and you posted in sql 2000 forum.
#2, you can find all you need to know in books online 2k5 about this.
The short answer is that this query is manually building a identity for each person / departement combinaisons.
I will suggest you copy the tables to a dev environement and run the query yourself. You'll see exactly what it's doing.