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

前端 未结 3 1654
隐瞒了意图╮
隐瞒了意图╮ 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:24

    You can only use := for assignment - never for comparison. It's just a bit of syntactic sugar, it doesn't really change the functionality at all. You'll see it a lot in generated SQL from code.

提交回复
热议问题