View Single Post
Old 12-28-2010, 12:31 PM  
potter
Confirmed User
 
Industry Role:
Join Date: Dec 2004
Location: Denver
Posts: 6,559
MySQL Update / Join on match

I keep getting stuck trying to figure this one out. I have two tables. One is a list of articles, the other is a list of users.

articles table: userid, name, articletitle, articletext, postdate

users table: userid, name

The articles table is fully populated except for the name column. So I need to update / join the articles table - name column, with the users table - name column, where the userid from both match.

I've tried to find an example online, but they all use the standard t.1 or t.2 generic descriptions for the columns and I can't wrap my head around it without seeing better descriptors prudent to my exact situation (like "name" and "userid" in the example).

Like I swear it's (SELECT * FROM table1 as t1 INNER JOIN table2 as t2 ON t2.t1_id = t1.t2_id) or something as I've used it in the past. But when I wrote it down in my notes I didn't provide better descriptors.

__________________

potter is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote