user1915108 user1915108 - 2 years ago 126
SQL Question

deleting multiple rows from sql table

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?

Answer Source


DELETE FROM tablename WHERE name IN ('h', 'r')
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download