메뉴 닫기

SQL DELETE Statement

The SQL DELETE syntax

The general syntax is:

  1. DELETE tablename

To delete specific records append a WHERE clause:

  1. DELETE tablename
  2. WHERE condition

 


 

SQL DELETE Examples

Problem: Delete all products.

  1. DELETE Product

Results: 77 records deleted.


Problem: Delete products over $50.

  1. DELETE Product
  2. WHERE UnitPrice > 50

Results: 7 records deleted.


Problem: Delete customer with Id = 21.

  1. DELETE Customer
  2. WHERE Id = 21

This is a more common scenario in which a single record is deleted.
Results: 1 record deleted.

6 Comments

  1. Frederick Marsala

    I simply want to say I’m new to blogging and really savored your page. Very likely I’m want to bookmark your website . You definitely have fantastic articles and reviews. Thank you for sharing your web-site.

  2. lebron 17

    This is the suitable blog for anyone who desires to find out about this topic. You notice so much its nearly hard to argue with you (not that I really would need匟aHa). You undoubtedly put a new spin on a subject thats been written about for years. Great stuff, just nice!

  3. kobe byrant shoes

    I discovered your weblog site on google and check a couple of of your early posts. Continue to keep up the excellent operate. I simply additional up your RSS feed to my MSN Information Reader. In search of forward to studying extra from you in a while!?

댓글 남기기

이메일은 공개되지 않습니다.