MySQL compare 2 table match columns
Posted on 2011-10-09
i have two tables Table1 and Table2 each with different column names but housing the same data. Table 1 has a primary key called MLNUM and Table 2 has a primary key called MLSNUMBER for example but both contain a record with a matching value for their columns example: 201104995.
If I use a value that is found in both tables as the primary key (example: 201104995) how can I compare the two tables and get the names of columns where the data matches for that record in each table..
For example, if I use 201104995, I can manually match up that column City in Table1 and column ListingCity in Table2 as both have the same data.
There is close to 100 columns in each table so this is very hard to do manually. How can save some work and do this with a query?