![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
In ASA 6 this select worked correctly SELECT T1.ID, DESCR, min(DATE) as MINDAT,STATE FROM T1, T2 WHERE T1.ID=T2.ID AND MNDAT is not null G GROUP BY T1.ID, DESCR,STATE ORDER BY DESCR |
|
In ASA 9 the select returns this error: Invalid use of an aggregate function SQLCODE=-150, ODBC 3 State="42000" Line 1, column 1 What is wrong? |
#3
| |||
| |||
|
|
"Robin" <. (AT) iol (DOT) it> wrote: In ASA 6 this select worked correctly SELECT T1.ID, DESCR, min(DATE) as MINDAT,STATE FROM T1, T2 WHERE T1.ID=T2.ID AND MNDAT is not null G GROUP BY T1.ID, DESCR,STATE ORDER BY DESCR Unfortunately, ASA6 allowed some syntax errors to slip through; ASA9 query parser is more strict. In ASA 9 the select returns this error: Invalid use of an aggregate function SQLCODE=-150, ODBC 3 State="42000" Line 1, column 1 What is wrong? This should work: SELECT T1.ID, DESCR, min(DATE) as MINDAT,STATE FROM T1, T2 WHERE T1.ID=T2.ID AND GROUP BY T1.ID, DESCR,STATE HAVING MINDAT is not null // note this ORDER BY DESCR Dmitri. |
![]() |
| Thread Tools | |
| Display Modes | |
| |