• Hugo Kornelis (3/28/2011)


    I was surprised at first at the "SELECT @i+=1" syntax. I knew about the compount operators and have happily used "SET @i=1", but seeing never realised that it can equally well be used with SELECT.

    I have found the use of variable value allocation and updating using SELECT to be very efficient and handy.

    i.e., assigning or updating several variables using SET can only be assigned to 1 variable at a time, e.g.

    SET @Var1 += x

    SET @Var2 -= y

    SET @Var3 = ''

    while this could be effected in one instruction using the SELECT, e.g.

    SELECT @Var1 += x, @Var2 -= y, @Var3 = ''

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”