Reputation: 115
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'
Upvotes: 0
Views: 92
Reputation: 8587
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).
Upvotes: 3
Reputation: 3517
A simple update should work. Something like:
UPDATE patient
SET sercurity_level='2'
WHERE security_level='1';
Edit: changed correct table name and added quotes
Upvotes: 1