select *
from (
select '1 ' as table_name,count(1) as cnt union all
select '2 ' as table_name,count(1) as cnt union all
select '3 ' as table_name,count(1) as cnt
) t1
where table_name <> '1'
;
-- RDS
+------------+-----+
| table_name | cnt |
+------------+-----+
| 2 | 1 |
| 3 | 1 |
+------------+-----+
-- ADB
+------------+------+
| table_name | cnt |
+------------+------+
| 3 | 1 |
| 1 | 1 |
| 2 | 1 |
+------------+------+
-- ODPS
+------------+------------+
| table_name | cnt |
+------------+------------+
| 1 | 1 |
| 2 | 1 |
| 3 | 1 |
+------------+------------+
-- 结论: ADB和ODPS对字符串中空格敏感,而RDS不敏感,可能是sql_mode设置的问题。