当前位置:网站首页>Expression #1 of ORDER BY clause is not in SELECT list, references column ‘d.dept_ no‘ which is not i

Expression #1 of ORDER BY clause is not in SELECT list, references column ‘d.dept_ no‘ which is not i

2022-07-04 16:11:00 Liluoxiao

problem :"Expression #1 of ORDER BY clause is not in SELECT list, references column 'd.dept_no' which is not in SELECT list; this is incompatible with DISTINCT"

Add distinct Report a mistake later

reason : When using grouping function or window function ,order by The following field name should be the same as select The field names after are consistent

solve : In this case select The last field is named de.dept, and order by The latter is d.dept, Need to put d.dept Change to de.dept

原网站

版权声明
本文为[Liluoxiao]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202141156206126.html