1

I got a sql table, say of the form

name         age
h             1
a             2
r             3
i             4

I want to delete the 1st row and 3rd row. I want something of the form,

delete from tablename where name=h,r;

is this the correct syntax?

5 Answers 5

10

Try:

DELETE FROM tablename WHERE name IN ('h', 'r')
Sign up to request clarification or add additional context in comments.

Comments

2

Try

delete from tablename where name='h' or name='r';

Comments

2
You may use or operator or in condition like
delete from tablename where name='h' or name='r';

delete from tablename where name in ('h', 'r');

Comments

1

You need to use conditional operator such as `OR,

DELETE FROM tablename 
WHERE  name = 'h' OR name ='r'

Comments

1

You may use or operator or in condition like

delete from tablename where name='h' or name='r';

Or

delete from tablename where name in ('h', 'r');

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.