• What bit don't you understand?

    If the answer is all of it then you may need to look at TSQL tutorials online...

    Mack