<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>database on Two Tigers Engineering</title>
    <link>https://blog.twotigers.xyz/series/database/</link>
    <description>Recent content in database on Two Tigers Engineering</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 13 Oct 2021 16:00:08 +0800</lastBuildDate><atom:link href="https://blog.twotigers.xyz/series/database/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>数据库跟 null 比较会得到非预期结果</title>
      <link>https://blog.twotigers.xyz/posts/database/operator/</link>
      <pubDate>Wed, 13 Oct 2021 16:00:08 +0800</pubDate>
      
      <guid>https://blog.twotigers.xyz/posts/database/operator/</guid>
      <description>现象 在执行 sql 中得到了非预期结果
select * from user where age &amp;gt; 20; 其中, 数据库中存在大量的 age 为 null 的记录, 在执行完上述 sql 后, 没有将 age is null 的数据查出
测试 SELECT 1&amp;gt;=1, NULL = NULL, Null &amp;gt; 1; mysql 5.7.21-log sqlite 3.34.0 postgresql PostgreSQL 14.0 (Debian 14.0-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit 原因 stackoverflow
在 The Three-Valued Logic of SQL 中规定, 与 null 比较返回值为 null
The SQL null value basically means “could be anything”.</description>
    </item>
    
    <item>
      <title>alpine docker container 中安装 mysql client</title>
      <link>https://blog.twotigers.xyz/posts/database/docker/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://blog.twotigers.xyz/posts/database/docker/</guid>
      <description>apk add mysql mysql-client </description>
    </item>
    
  </channel>
</rss>
