Subject | Re: [ib-support] Automatically remove unused PK's from second table?? |
---|---|
Author | Svein Erling Tysvær |
Post date | 2002-06-07T06:54:50Z |
Derek,
DELETE FROM t_cars
WHERE NOT EXISTS (SELECT 1 FROM t_persons
WHERE t.persons.car_id_fk = t_cars.car_id_pk)
Set
>How do I remove the car types that are no longer referenced with aThe SQL to be used would be:
>foreign key in the t_persons table?
DELETE FROM t_cars
WHERE NOT EXISTS (SELECT 1 FROM t_persons
WHERE t.persons.car_id_fk = t_cars.car_id_pk)
Set