mysql中操作符的意思

<span style="font-size:14px;"><span style="color:rgb(51,51,51);font-family:'Lucida Grande',Verdana,'Bitstream Vera Sans',Arial,sans-serif;">MysqL中操作符<=>是安全等于的意思。<br style="color:rgb(51,sans-serif;"><span style="color:rgb(51,sans-serif;">是比较运算符,当比较的值含有null值的时候,来返回一个布尔值。比如:<br style="color:rgb(51,sans-serif;">select 1<=>null -- 结果为0

null -- 结果为1。

内容:

nofollow">http://kb.cnblogs.com/page/203622/

<ul style="font-family:verdana,Helvetica,sans-serif;color:rgb(35,35,35);list-style:none;"><li style="font-size:14px;list-style:disc;"> <span style="color:rgb(51,51);">问题 :

<p style="font-family:verdana,sans-serif;font-size:14px;color:rgb(35,35);">
  我在看以前的一个开发者的代码时看到


<div class="cnblogs_code" style="font-family:'Courier New';font-size:14px;border:1px solid rgb(204,204,204);overflow:auto;line-height:25.200000762939453px;color:rgb(35,35);">
<pre style="margin-left:2em;font-family:'Courier New';font-size:12px;"><span style="color:rgb(0,255);">WHERE p.name <span style="color:rgb(128,128,128);"><=> <span style="color:rgb(0,255);">NULL

在这个查询语句中 <=>符号是什么意思啊?是不是和 =号是一样啊?还是一个语法错误啊?但是没有显示任何错误或者异常。我已经知道了MysqL中的 <> = !=等符号。

    ’B'得0和’a'<=>’a‘得1。

    ,

      'a' <=> NULL 得0   NULL<=> NULL 得出 1。和=运算符正相反,=号运算符规则是 'a'=NULL 结果是NULL 甚至NULL = NULL 结果也是NULL。顺便说一句,MysqL上几乎所有的操作符和函数都是这样工作的,因为和NULL比较基本上都没有意义。

      disc;">

    一个一致的语句。

    col_a ? ...

    运算符时,你没有必要对查询语句做任何修改

      ,还有两个其他的操作符用来处理某个值和NULL做比较,也就是IS NULL and IS NOT NULL。他们是ANSI标准中的一部分,因此也可以用在其他数据库中。而<=>只能在MysqL中使用。

      当作MysqL中的方言。

      <span style="color:rgb(255,255);">IS <span style="color:rgb(128,128);">NOT <span style="color:rgb(0,255);">NULL <span style="color:rgb(128,128);">==> <span style="color:rgb(128,128);">NOT(<span style="color:rgb(255,255);">NULL)

      查询语句段改的更具移植性一点:

      p.name

      相关文章

      优化MySQL数据库发布系统存储的方法有:1.mysql库主从读写分...
      使用mysql的方法:在“我的电脑”→右键→“管理”→“服务”...
      在mysql中查看root用户权限的方法:1.命令行启动mysql服务;...
      MySQL主从复制是用来备份一个与主数据库一样环境的从数据库,...
      运行mysql的方法1.启动mysql服务,在“我的电脑”→右键→“...
      开启mysql的方法1.可以通过快捷键win+r,输入cmd,打开窗口,...