Link to home
Start Free TrialLog in
Avatar of xander031
xander031

asked on

group by a computed column didn't work in sybase. why?

In Sybase adaptive server 11, the following gave me 'invalid column name mnth'. How can I summarize sales by month?

select sum( subtotal ) as sales_summary,
  datediff ( mm,  'Jan 1 2000', order_date ) as mnth
from sales_order
where mnth > 0
group by mnth
ASKER CERTIFIED SOLUTION
Avatar of AlexJ030200
AlexJ030200

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of xander031
xander031

ASKER

I wonder whether the query optimizer will eliminate redundant calls of the function?
Sure it will, as long as they are written identically.