0

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?

1 Answer 1

1

That's not insert rather update.

update table_name set roll_no = 'Z' where name='X' and age='Y'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.