Subject | need help deleting duplicate rows |
---|---|
Author | Mark Meyer |
Post date | 2001-11-03T02:57:30Z |
hello everyone..
i am new to IB.
as a result of a very large conversion project - we have a Service_fees
table that has several instances of dupicate rows. originally we thought it
would be easy to identify and delete the dups - but this has not been the
case.
we were able to identify them easily enough with the following sql (see
below) - but deleting them has been more of a challenge.
i have tried writing a delphi program - but we keep getting an exception
when we try to delete one of the dups. basically the error message from
delphi is - i was expecting 1 row but i got back multiple rows - which one
do you really want me to delete.
any help would be greatly appreciated.
thx
mark
CREATE TABLE SERVICE_FEES (
SERVICE_KEY REQUIRED_LONG,
FEE_KEY REQUIRED_LONG,
FEE_AMOUNT MONIES,
WAIVED CHAR_1,
FLIGHT_KEY REQUIRED_LONG
)
CREATE ASCENDING INDEX SERVICE_FEESINDEX1 ON SERVICE_FEES (SERVICE_KEY,
FLIGHT_KEY)
select
count(*),
a.service_key,
a.fee_key,
b.service_type
from
service_fees a,
services b
where
b.service_key = a.service_key
group by
a.service_key,
a.fee_key,
b.service_type
having
count(*) > 1
CONFIDENTIALITY NOTICE: The information contained in the transmission is
considered by TravelCLICK and the sender to be confidential. This material
is intended only for the use of the recipient(s) named above and may not be
disclosed to others without express written consent of the sender.
[Non-text portions of this message have been removed]
i am new to IB.
as a result of a very large conversion project - we have a Service_fees
table that has several instances of dupicate rows. originally we thought it
would be easy to identify and delete the dups - but this has not been the
case.
we were able to identify them easily enough with the following sql (see
below) - but deleting them has been more of a challenge.
i have tried writing a delphi program - but we keep getting an exception
when we try to delete one of the dups. basically the error message from
delphi is - i was expecting 1 row but i got back multiple rows - which one
do you really want me to delete.
any help would be greatly appreciated.
thx
mark
CREATE TABLE SERVICE_FEES (
SERVICE_KEY REQUIRED_LONG,
FEE_KEY REQUIRED_LONG,
FEE_AMOUNT MONIES,
WAIVED CHAR_1,
FLIGHT_KEY REQUIRED_LONG
)
CREATE ASCENDING INDEX SERVICE_FEESINDEX1 ON SERVICE_FEES (SERVICE_KEY,
FLIGHT_KEY)
select
count(*),
a.service_key,
a.fee_key,
b.service_type
from
service_fees a,
services b
where
b.service_key = a.service_key
group by
a.service_key,
a.fee_key,
b.service_type
having
count(*) > 1
CONFIDENTIALITY NOTICE: The information contained in the transmission is
considered by TravelCLICK and the sender to be confidential. This material
is intended only for the use of the recipient(s) named above and may not be
disclosed to others without express written consent of the sender.
[Non-text portions of this message have been removed]