Update table

hi,
I need to update a table called "MyTable", this table has several columns but one of the columns may contain blanks sometime and i want to populate the blanks with onother column's data.  Here is how it look like my table:

ID                  NAME           TP_NAME            LOCATION
20                 ABC                LLM12                   NC
40                 MOX                XX14                     WA
25                 MMX                                              AZ
88                 XXX                                               OH
45                 LLP                 MO56                      KS

So in this case, since TP_NAME for ID 25 is blank i would like to update it with the same data as the NAME (MMX).  After the update, my table should look like this:
20                 ABC                LLM12                   NC
40                 MOX                XX14                     WA
25                 MMX                MMX                       AZ
88                 XXX                 XXX                       OH
45                 LLP                 MO56                      KS
karinos57Asked:
Who is Participating?
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
update MyTable
set TP_NAME    = Name
where tp_name is NULL or TP_Name  = ''
0
 
waltersnowslinarnoldConnect With a Mentor Commented:
This will do..

update
MyTable
set
TP_NAME    = NAME
where
TP_NAME IS NULL or TP_NAME  = ''
0
 
karinos57Author Commented:
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.