Hi. I'm using psql. We are going to be upgrading to the new SQL version of our ticketing program JWS ver 4 and I am trying to purge some of the records from our ticket file. I purged the invoice table for all invoices < 7/1/2009 and now I'm trying to set up a query to delete all the tickets that are on the purged invoices. Here is my query for the count of the number of Tickets that won't be purged:
select count(t1.ticketno) from tkhist1 t1, arhist t2 where t1.invoiceno = t2.transno;
Now I need to write a "delete from tkhist1" query to delete only the tickets where t1.invoiceno <> t2.transno. I can't seem to find the syntax to do it. I know how to do a delete from a single table, but this has me stumped.
Thanks for any help you can give me.
Cathy
select count(t1.ticketno) from tkhist1 t1, arhist t2 where t1.invoiceno = t2.transno;
Now I need to write a "delete from tkhist1" query to delete only the tickets where t1.invoiceno <> t2.transno. I can't seem to find the syntax to do it. I know how to do a delete from a single table, but this has me stumped.
Thanks for any help you can give me.
Cathy