Where can I find documentation about "set @i -=-+-+-@i " construction

  • When I was trying what kind of construction TSQL in SQL 2008 would allowed I came at this stupid construction.

    declare @i bigint = 6

    set @i -= @i

    print @i

    SET @i = 6

    set @i -=-@i

    print @i

    SET @i = 6

    set @i -=-+@i

    print @i

    SET @i = 6

    set @i -=-+-@i

    print @i

    print @i

    SET @i = 6

    set @i -=-+-+@i

    print @i

    SET @i = 6

    set @i -=-+-+-@i

    print @i

    the result was

    0

    12

    12

    0

    0

    0

    12

    My question is where can I find something about this construction "-+-+-" and is there any use for this?

  • I am sorry This is sql 2008.

    i repost it in the correct group

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply