SELECT DISTINCT ON expressions must match initial ORDER BY expressions
2019-11-15 14:32 abce 阅读(1635) 评论(0) 编辑 收藏 举报开发说pg中执行sql报错,发来消息让帮看看:
SELECT DISTINCT ON expressions must match initial ORDER BY expressions
详细语句如下:
SELECT DISTINCT ON ( p_no ) p_no, p_name, p_manager, p_manager_no, p_dept FROM P WHERE corporation = $1 AND status = $2 ORDER BY create_time DESC
失败的原因看看官方文档就知道了: