Cause: java.sql.SQLException: Expression #1 of ORDER BY clause is not in SELECT list
时间: 2023-10-16 17:08:06 浏览: 185
这个错误是由于在ORDER BY子句中引用了一个不在SELECT列表中的列导致的。具体来说,错误信息中的"Expression #1 of ORDER BY clause is not in SELECT list, references column ‘meigo.st_order.payment_time’ which is not in SELECT list; this is incompatible with DISTINCT"就是指出了问题所在。根据引用和引用的内容,可以看出这个错误是由于在使用DISTINCT关键字进行查询时,加入了一个不在SELECT列表中的列作为排序的依据导致的。此外,引用提供了具体的SQL语句,可以看到在SELECT子句中并没有包含payment_time列,但是在ORDER BY子句中却引用了该列,这就导致了错误的发生。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [java.sql.SQLException: Expression #1 of ORDER BY clause is not in SELECT list, references column ...](https://blog.csdn.net/qq_38314062/article/details/121350610)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文