This SQL should not compile
---------------------------

                 Key: CORE-6156
                 URL: http://tracker.firebirdsql.org/browse/CORE-6156
             Project: Firebird Core
          Issue Type: Bug
            Reporter: Attila Molnár


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!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to