240
世界上有10种人,一种懂二进制,另一种不懂二进制。

1250 - Table 'd' from one of the SELECTs cannot be used in field list

1 问题描述

sql数据库查询接口union后order by 某字段,提示错误“1250 - Table 'd' from one of the SELECTs cannot be used in field list“。

移除order by 条件,就不会报错,但是不满足按照某个字段排序。

 

2 方案解决

修改排序条件为:order by statId 即可。(union后的结果是字段的别名,所以要order by 某字段别名)

3 参考

[1] https://blog.csdn.net/it_model/article/details/108242900

posted @ 2024-05-13 17:07  unionline  阅读(229)  评论(0编辑  收藏  举报