Hello,
i have 6 columns in my table and i need to run a query as mentioned below but i get an error message while running, please assist. thanks.
select
column1,
trim(column2) as column2_trim, ---uses a combination of trim, instr and mid functions to drive a text from a field
count(column2_trim), ---- i want to do a count on the previous column
column3,
column4,
sum(column5),
ABS(column5)
from table1
where column1 = 'sample1'
group by
column1,
column3,
column4;
i get the error:
you tried to execute a query that does not include the specified expression 'column2_trim' as part of an aggregate function.
can you please point me to what im doing wrong? thanks.