加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

mysql中操作符的意思

发布时间:2020-12-12 00:01:50 所属栏目: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

<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。

<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比较基本上都没有意义。

      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

        (编辑:李大同)

        【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

          推荐文章
            热点阅读