Search code examples
sqlsql-serveralter

Updating value in a column SQL Server


This should be a really easy question, but I wanted to make sure it was done right where I'm not a SQL guy. We need to turn all of the patients with a security level of 1 to 2. All patients who are not at 1 are currently at 2. Thanks and sorry for asking such a simple question. SQL Server 2005.

select 

patient_id,
security_level

from patient
where security_level = '1'

enter image description here


Solution

  • SQLFIDDLE

    update patient set security_level = '2' 
    where security_level = '1';
    

    Above will update the entire patient table, and set the security level to 2 (where it initially was 1).