‎2009 Oct 06 7:32 AM
Hi,
Can I write a query like:
select field1 field2 MAX( field3 )
from z_table
into table itab
for all entries in itab2
where field1 = itab2-field1
and field2 = itab2-field2.
In the above case all the 3 fields are key fields.
Thanks in advance.
‎2009 Oct 06 7:40 AM
hi
try this
select , max() as field2, min() as field3, ...
from........
‎2009 Oct 06 7:38 AM
‎2009 Oct 06 7:40 AM
hi
try this
select , max() as field2, min() as field3, ...
from........
‎2009 Oct 06 7:43 AM
Hi,
I did try it.. but got an error like: "The field "z_table~field2" from the select list is missing in the GROUP BY clause" but my aggregate funtion is used only for the field3..... So, I wanted to know if anybody has come across such a query....
Thanks,
‎2009 Oct 06 7:46 AM
If there is only one max function in the select you do not need a group by. In your case, you need one. But this was told you by the compiler....
‎2009 Oct 06 7:48 AM
Check online help for aggregate functions. All selected columns which are not used as aggregate functions must appear in the GROUP BY clause.
Thomas
‎2009 Oct 06 8:07 AM
Hi All,
The code works fine after the group by clause.
Thanks for your help.
Thanks,
Sindhu