Sure. First use a temp table (or cursor) to load your text file, then do
(to create a cursor you may do - select * from myOrder where 1 = 0 into cursor curTempStocks readwrite)
insert into myOrder select StockID, SUM(amount) as TotalAmount from curTempStocks group by StockID
>I receive the order in text file:
>
>
>3001 10
>3002 5
>3001 6
>3002 4
>
>
>I append them to the table:
>
>
>use myorder
>append from "order.txt" sdf
>
>
>then I get:
>
>
>StockId Qty
>------- ----
>3001 10
>3002 5
>3001 6
>3002 4
>
>
>while I wish the same StockId will be total together:
>
>
>StockId Qty
>------- ----
>3001 16
>3002 9
>
>
>is there any easy way to do it?
>
>thanks for the help
If it's not broken, fix it until it is.
My Blog