|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
I have 2 tables the first table custAddress contains the fields recordNum,
first name, last name, address, city, state, zip, phone the second table called corrected_info and contains recordNum, first name, last name, address, city, state, zip but no phone how would I update custAddress with the corrected info in the second table without losing the phone numbers? I need to do this in sql. if anyone has an idea please let me know. TIA URL |
|
#2
|
||||
|
||||
|
Something like this perhaps:
Code:
UPDATE ca
SET ca.first_name = ci.first_name,
ca.last_name = ci.last_name,
ca.address = ci.address,
ca.city = ci.city,
ca.state = ci.state,
ca.zip = ci.zip
FROM custAddress AS ca
INNER JOIN corrected_info AS ci
ON ca.recordNum = ci.recordNum
DISCLAIMER: I have not actually tested the above statement. Back up your data before trying it out. Hope this helps ![]()
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > sql riddle |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|