错误复现
先写一个这样的语句在测试环境下运行:
SELECT some_field1 FROM ( SELECT some_field1 from some_table where cond = 1 union all SELECT some_field1 from some_table where cond = 888 ) LIMIT 0, 50;
就会报上述故障Every derived table must have its own alias, 中文意思是少了个表别名, 加上就OK, 改成以下:
SELECT some_field1 FROM ( SELECT some_field1 from some_table where cond = 1 union all SELECT some_field1 from some_table where cond = 888 ) tbl LIMIT 0, 50;
完结撒花