How can I choose the closest match in SQL Server 2005?
问题 In SQL Server 2005, I have a table of input coming in of successful sales, and a variety of tables with information on known customers, and their details. For each row of sales, I need to match 0 or 1 known customers. We have the following information coming in from the sales table: ServiceId, Address, ZipCode, EmailAddress, HomePhone, FirstName, LastName The customers information includes all of this, as well as a 'LastTransaction' date. Any of these fields can map back to 0 or more