On Aug 26, 5:40am, xiangz@rocketmail.com wrote:
> Subject: why I can't group by an expression
You can.
Change the GROUP BY in your SQL to reference the columns in the
order they appear in the SELECT clause.
insert into sum_mon_reg
select region,
sum(sales) sum_sales,
month(date) date
from sales
group by 1,3 <======
______________________________________________________________________
Mr Sandy J. Speirs
M.I.S Tel : (847) 523-4845
Motorola Inc.
Cellular Subscriber Sector Fax : (847) 523-4421
600 N. Highway 45, Room il93/AS-438 EMail: Sandy_Speirs@csg.mot.com
Libertyville, IL 60048 Home : sspeirs@iconnect.net
My own opinions only.