I have a question which has come up and want to make sure I am doing this the best way. If I have three columns:
Table: Invoices
- InvoiceNumber
- InvoiceAmount
- InvoiceDate
I then have a temp table that has the same three fields where I will have invoice records all for the the same InvoiceDate
.
I need to update the amount of the Invoices
table based on InvoiceNumber
and InvoiceDate
.
Is it best to just join on the two columns, or what I am doing is using the InvoiceDate
in the Where
clause as the main Invoices
table is really large and I thought that where filter is better. There will only be one record per InvoiceNumber
and InvoiceDate
but I was thinking the filter down of just that date then join on the invoice number and the Update statement would be more performant.
What is the better approach?