How can I merge only the relevant results in SQL
February 21, 2013 6:29 AM Subscribe
I have a table in my database.
It has a bunch of 4 digit codes representing a location (as well as other data).
The problem is that some of these locations need to be replaced with an updated code. I have a second table with the substitutions that need to be made, but it is only a small minority of codes that need updating.
How do I format my SQL statement to produce me a list of all records, with the new location code if it has a new code and the old code if there is no update needed.
posted by Just this guy, y'know to computers & internet (12 answers total) 1 user marked this as a favorite
There are actually two columns using these location codes (origin and destination) can I update both these columns at the same time in the same way?