Reputation: 2250
I have a table called student like:
name age roll_no
X Y
I want to write a sql query such that if name='X' and age='Y' then insert 'Z' to roll_no. How can I do that?
Upvotes: 0
Views: 26
Reputation: 44844
That's not insert rather update.
update table_name set roll_no = 'Z' where name='X' and age='Y'
Upvotes: 1