[SGVLUG] SQL Question - UPDATE - Ignore

Greg Stark gstark at electrorent.com
Mon Feb 19 13:59:43 PST 2007


Please ignore. I was able to answer this question myself, and in deleting
it, sent it.
Greg

> -----Original Message-----
> From: sgvlug-bounces at sgvlug.net [mailto:sgvlug-bounces at sgvlug.net] On
> Behalf Of Greg Stark
> Sent: Monday, February 19, 2007 1:55 PM
> To: 'SGVLUG Discussion List.'
> Subject: [SGVLUG] SQL Question - UPDATE
> 
> I can't seem to wrap my mind around this problem.
> 
> I need to update a column in a table(1) where the source comes from
> another
> table(2) base on a value from that row for the whole table(1).  What I do
> not want to do is loop through table(2).  Let me illustrate.
> 
> Table1 has columns: FullState, State + other columns
> Table2 has just columns: FullState, State
> 
> I want to update the State in Table1 with the State in Table2
> where Table1.FullState = Table2.FullState
> 
> UPDATE Table_1
> SET State = [Table_2].[State]
> FROM Table_2
> WHERE [Table_1].[FullState]=[Table_2].[FullState]Thank you.
> 
> Greg
> 





More information about the SGVLUG mailing list