New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This SQL should not compile [CORE6156] #6405
Comments
Commented by: @aafemt Subquery is inside of aggregation function so there is no problem with it. Tracker is not a support list. |
Commented by: Attila Molnár (e_pluribus_unum) I understand, this SELECT but in the original case the aggregate was on the result of the subselect. To get the resultset what p.proj_id used in the original case? (BTW the yahoo support group is not so alive. I reported CORE6151 there a weak before here, but still no answen on that forum. At leas this tracker is resposive. |
Commented by: Sean Leyne (seanleyne) As Dmitry noted: - The SQL is valid |
Modified by: Sean Leyne (seanleyne)status: Open [ 1 ] => Resolved [ 5 ] resolution: Won't Fix [ 2 ] |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Submitted by: Attila Molnár (e_pluribus_unum)
We have a similar structura SQL in our code, I rewrite it to EMPLOYEE.FDB.
SELECT
e.emp_no
FROM employee e
JOIN employee_project p ON p.emp_no = e.emp_no
GROUP BY e.emp_no
HAVING MAX((SELECT
SUM(e2.salary)
FROM employee e2
JOIN employee_project p2 ON p2.emp_no = e2.emp_no
WHERE e2.emp_no = e.emp_no AND
p2.proj_id IS NOT DISTINCT FROM p.proj_id)) <> 0
Why this is compiles? In the subselect p.proj_id should not be accepted - group does not contains it, and has no aggregate on it. What value the current engine choose when it runs, and why?
Thank you!
The text was updated successfully, but these errors were encountered: