• For some reason I'm getting loads of "Incorrect syntax" errors while trying to compile this

    edit:

    what version of SQL were you using to write this?

    --
    Thiago Dantas
    @DantHimself