Updating a table with multiple values from a select statement where the date matches?

You can use the UPDATE FROM syntax for this.

You can use the UPDATE FROMsyntax for this. Have a look at the syntax here and here. FROM (table_source) Specifies that a table, view, or derived table source is used to provide the criteria for the update operation UPDATE t1 SET t1.

Figure = data1. Figure FROM t1 INNER JOIN data1 ON data1. Month = t1.month.

1 thanks, worked! – Lee_McIntosh Aug 11 '10 at 14:11 @Lieven: thanks for the answer. It helped solve my problem: leniel.Net/2011/08/update-select-sql-server-image-column.

Html – Leniel Macaferi Aug 6 at 16:44 @Leniel Macaferi - now this is the first time I'm mentioned in a blog. I'm going to print this and put it above my bed :) – Lieven Aug 7 at 10:15.

UPDATE t1 SET t1. Figure = data1. Figure FROM table1 t1 JOIN data1 d1 ON (t1.

Month = d1. Month).

SQL Server 2008: MERGE INTO Table1 USING data1 AS D1 ON Table1. My_Month = D1. My_Month WHEN MATCHED THEN UPDATE SET Figure = D1.

Figure; Pre-SQL Server 2008: UPDATE Table1 SET Figure = ( SELECT D1. Figure FROM data1 AS D1 WHERE Table1. My_Month = D1.

My_Month ) WHERE EXISTS ( SELECT * FROM data1 AS D1 WHERE Table1. My_Month = D1. My_Month ); Note the UPDATE..FROM syntax is proprietary and can yield unpredictable results when a target row matches more than one source row.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions