Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Delete Multiple Rows from a Table
How To Delete Multiple Rows from a Table? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements
✍: FYIcenter.com
You can delete multiple rows from a table in the same way as deleting a single row, except that the WHERE clause will match multiple rows. The tutorial exercise below deletes 3 rows from the fyi_links table:
mysql> SELECT id, url, notes, counts FROM fyi_links WHERE id > 300; +-----+-------------------+-------+--------+ | id | url | notes | counts | +-----+-------------------+-------+--------+ | 801 | moc.retneciyf.ved | Wrong | 1602 | | 802 | moc.retneciyf.abd | Wrong | 1604 | | 803 | moc.retneciyf.aqs | Wrong | 1606 | | 810 | | Wrong | 1620 | | 700 | moc.retneciyf.www | Wrong | 1400 | +-----+-------------------+-------+--------+ 5 rows in set (0.00 sec) mysql> DELETE FROM fyi_links WHERE id > 300; Query OK, 5 rows affected (0.00 sec) mysql> SELECT id, url, notes, counts FROM fyi_links WHERE id > 300; Empty set (0.00 sec)
2007-05-11, 4849👍, 0💬
Popular Posts:
How To Use mysqlbinlog to View Binary Logs? - MySQL FAQs - Server Daemon mysqld Administration If yo...
How To Return the Second 5 Rows? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries If yo...
How To Delete a User Account? - Oracle DBA FAQ - Managing Oracle User Accounts, Schema and Privilege...
Can one execute dynamic SQL from Forms? Yes, use the FORMS_DDL built-in or call the DBMS_SQL databas...
How to measure functional software requirement specification (SRS) documents? Well, we need to defin...