cancell duplicate orders
Posted on 2008-11-18
I have a situation in the CustOrder table, for some reason I have noticed they were duplicate orders have been recorded,
the job which runs every wednesday considered it as new orders and submitted them to the broker to process.
I have loads of orders which I want to set the status from "2 Shared Ordered" to "Cancelled" for all those duplicate records.
in the sample below if you please see for "adam collins" they were 3 orders captured by the system all at "2008-09-10 07:40:03"
They have been sent to the broker for 3 times,
first at "2008-10-29 02:20:02" and then "05/11" and "12/11"
All I wanted to now is to keep the first record as it and set the status="Cancelled" for the other 2.
Please can someone advise me the SQL query for this?