工会后为什么只有一个记录?

omg*_*omg 0 mysql sql union

mysql> select count(id) total from applicants;
+-------+
| total |
+-------+
|     0 |
+-------+
1 row in set (0.00 sec)

mysql> select count(id) total from jobs;
+-------+
| total |
+-------+
|     0 |
+-------+
1 row in set (0.00 sec)

mysql> select count(id) total from applicants union select count(id) total from
jobs;
+-------+
| total |
+-------+
|     0 |
+-------+
1 row in set (0.00 sec)

mysql>
Run Code Online (Sandbox Code Playgroud)

是不是应该有两个记录"0"作为其值?

Mar*_*rtW 5

Union All将发表两个声明.Union尝试组合条目,或者更确切地说,删除重复的行.