insert into tableA (column1)
select min(tableC.column1)
from tableB
inner join tableC on (tableC.coumn2 = tableB.column1
and tableB.column2 = tableA.column2)
group by tableA.column2
How would I change the above to a update with group by instead of insert with group by based on the criteria tableB.column2 = tableA.column2 ?
Note that I am using SQL SERVER 2008.
Is this what you want?
This will get for each columnA the
C.Column1min value, and will update it inA.Column1(that’s where you were inserting before), based on conditionA.Column2 = Grouped.Column2.here is a SQL-Fiddle Demo