Delete statement in mysql

The MySQL DELETE statement is used to delete a single record or multiple records from a table in MySQL.

With One condition

DELETE FROM users WHERE last_name = 'mahtab';

With Two conditions

DELETE FROM users WHERE last_name = 'mahtab' AND contact_id < 1000;

With LIMIT modifier

DELETE FROM contacts WHERE last_name = 'mahtab' ORDER BY contact_id DESC LIMIT 1;

DELETE FROM contacts ORDER BY contact_id DESC LIMIT 1;

Using EXISTS Condition

DELETE FROM suppliers WHERE EXISTS ( SELECT * FROM customers WHERE customers.customer_id = suppliers.supplier_id AND customer_id > 500 );





Previous Next


Trending Tutorials




Review & Rating

0.0 / 5

0 Review

5
(0)

4
(0)

3
(0)

2
(0)

1
(0)

Write Review Here


Ittutorial