What is the difference between = and := in MySQL?

前端 未结 3 1653
隐瞒了意图╮
隐瞒了意图╮ 2021-02-07 07:12

What is the difference in between

set test_var = 20;

and

set test_var:=20;

as they both seem to ass

3条回答
  •  北荒
    北荒 (楼主)
    2021-02-07 07:47

    It's more or less Syntactic sugar.

    Take a look here

    Most important difference is

    Unlike =, the := operator is never interpreted as a comparison operator. This means you can use := in any valid SQL statement (not just in SET statements) to assign a value to a variable.

提交回复
热议问题