Update Column in one table with data from another table

Hi all.  I have two tables

t.data
t.users.

Both tables have a column called user_id, however the column in t.data is blank.  t.data contains a column called email and t.users contains a column called user_email

How can I get the user_id values to t.data?
mostymAsked:
Who is Participating?
 
Umar Topia.Net Full Stack DeveloperCommented:
update t.data
inner join t.users
on t.data.email=t.users.user_email
set t.users.user_id=t.data.id
0
 
Kent OlsenData Warehouse Architect / DBACommented:
Hi mostym,

You're going to need one or more columns that are common to the two tables.  A primary key, unique indexed value, etc.

Kent
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
check this article out, please:
http://www.experts-exchange.com/A_1517.html
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.