I have a customer order table that list each item a customer purchases along with their name, order date. These are automatically populated when someone places an order, therefore if John Doe orders 5 items, there are 5 new rows added to the table (one for each item he ordered) and his name next to each one.
I have a separate customer billing table which has order date, customer name, and boolean fields for delivered, billed, paid (we deliver directly to the customer).
I'm trying to setup a trigger that automatically adds a new row for "John Doe" in the Customer Billing table when he places an order, but when I setup the trigger I get 5 new entries of his name (b/c his name was added on each of the items in the order table).
Anyway to do some sort of "distinct" insert with the triggers to solve this problem?