Home >Database >Mysql Tutorial >MySql小点心―1、赋值操作符"="与":_MySQL

MySql小点心―1、赋值操作符"="与":_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:41:14858browse

bitsCN.com
对于刚接触到mysql的程序员来说,会对这两个符号有疑问,因为会发现有的代码里用这个有的用另一个。

当然他们是有区别的。他们的区别也比较简单: “:=” 是真正意义上的赋值操作,左边的变量设置为右边的值。   "=" 则只在两种情况下作为赋值用,第一种就是在SET语句里面,SET var = value;
另一种是在UPDATE语句里面的那个SET,如update table_name set  column_name where....。

除了方面这两种情况外"="则作为比较操作符使用。 bitsCN.com

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn