thanks for pointing it out to me. Another question. I am trying to write a more extended CASE. the 'THEN' will return aggregates on some, but non-aggregates on others, the calculation generates an error, "cannot mix agg and non-aggs in CASE statement"
how should I wrap the others when i dont need a aggregate in order to avoid this error??
Please start a new thread