Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
@var := 0; 之间有区别吗?和@var = 0; ?
有和没有结肠?那有什么作用?
在SET的情况下,它们是同义词:
SET @var := 1234; SET @var = 1234;
但=在 a 中使用时充当条件运算符SELECT:
=
SELECT
SELECT @var := 1234; -- 1234 SELECT @var = 1234; -- 1
因此,通常最好坚持:=for assignment 以避免混淆。
:=