Table Update(DML)

 UPDATE students  
SET User_Name = 'beinghuman'  
WHERE Student_Id = '3' ;


UPDATE students  
SET User_Name = 'beserious', First_Name = 'Johnny'  
WHERE Student_Id = '3' ;

=========================================================================
update With Select Statement

UPDATE students  
SET students.col = value  
WHERE EXISTS 
(  
SELECT col2.value  FROM  student  
WHERE student.join_col = students. Join_col  
AND  student.Constraint = value
)  

WHERE Student_Id = '3' ;

=========================================================================

update with JOIN

CREATE TABLE table1 (column1 INT, column2 INT, column3 VARCHAR (100))  
INSERT INTO table1 (col1, col2, col3)
SELECT 1, 11, 'FIRST' union all
SELECT 11,12, 'SECOND' UNION ALL   
SELECT 21, 13, 'THIRD' UNION ALL   
SELECT 31, 14, 'FOURTH';


CREATE TABLE table2 (column1 INT, column2 INT, column3 VARCHAR (100))  
INSERT INTO table2 (col1, col2, col3)  
SELECT 1, 21, 'TWO-ONE'  UNION ALL  
SELECT 11, 22, 'TWO-TWO'  UNION ALL   
SELECT 21, 23, 'TWO-THREE'  UNION ALL   
SELECT 31, 24, 'TWO-FOUR'  


UPDATE table 1  
SET Col 2 = t2.Col2, Col 3 = t2.Col3  
FROM table1 t1  
INNER JOIN table 2 t2 ON t1.Col1 = t2.col1  
WHERE t1.Col1 IN (21,31)  
=========================================================================

update with DATE

UPDATE table   
SET EndDate = '2014-03-16 00:00:00.000'   
WHERE Id = 1