Deleting Rows with DELETE : Delete « Insert Delete Update « SQL / MySQL

Home
SQL / MySQL
1.Aggregate Functions
2.Backup Load
3.Command MySQL
4.Cursor
5.Data Type
6.Database
7.Date Time
8.Engine
9.Event
10.Flow Control
11.FullText Search
12.Function
13.Geometric
14.I18N
15.Insert Delete Update
16.Join
17.Key
18.Math
19.Procedure Function
20.Regular Expression
21.Select Clause
22.String
23.Table Index
24.Transaction
25.Trigger
26.User Permission
27.View
28.Where Clause
29.XML
SQL / MySQL » Insert Delete Update » Delete 
Deleting Rows with DELETE
    
/* Create the table */
Drop TABLE Professor;

CREATE TABLE Professor (
   ProfessorID INT NOT NULL PRIMARY KEY,
   Name        VARCHAR(50NOT NULL)
TYPE = InnoDB;

/* Prepare the data */
INSERT INTO Professor (ProfessorID,NameVALUES (1,'John Jones');
INSERT INTO Professor (ProfessorID,NameVALUES (2,'Cury Butz');
INSERT INTO Professor (ProfessorID,NameVALUES (3,'JJ Smith');


/* Real command */
DELETE FROM Professor WHERE ProfessorID > 2;
           
         
    
    
    
  
Related examples in the same category
1.Using DELETE LOW_PRIORITY command
2.Delete by JOIN
3.Delete with JOIN 2
4.Using the 'from join delete' Alternative to Delete Data
5.Delete row with condition
6.Delete statement with subquery (ERROR 1093 (HY000): You can't specify target table 'EmployeeS' for update in FROM clause)
7.DELETE statement using the alternative.
8.Joining Tables in a DELETE Statement
9.Delete with where clause
10.Delete ignore
11.Adding Subqueries to Your DELETE Statements
12.Delete All Threads Except the Last 500
13.Delete rows from multiple tables
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.