using aggregate function for selecting in the where definition catch problem 
-----------------------------------------------------------------------------

                 Key: CORE-5443
                 URL: http://tracker.firebirdsql.org/browse/CORE-5443
             Project: Firebird Core
          Issue Type: Bug
    Affects Versions: 3.0.1
            Reporter: Konstantin Streletsky


our project had migrated from firebird 2.5 to 3.0.1 and in some of specific 
statements arise a problem:

Dynamic SQL Error.
SQL error code = -104.
Cannot use an aggregate or window function in a WHERE clause, use HAVING (for 
aggregate only) instead.

here is a statement example(it works fine on 2.5): 

select first 1 
t1.date_sale
from some_table_1 t1 where 
sum((select (select p1.result from some_procedure_1(t1.date_sale,t2.summa) p1)
from some_table_2 t2 where t2.t1_id=t1.id))>0

if move the statement from where definition:

select first 1 
t1.date_sale,
sum((select (select p1.result from some_procedure_1(t1.date_sale,t2.summa) p1)
from some_table_2 t2 where t2.t1_id=t1.id))
from some_table_1 t1 where 
1>0

it works 

could it be a fix for this  ?

TY




-- 
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

        

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to