pcplans.com § Help and Support How to: using SQL to Delete Records  

How to: using SQL to Delete Records

Article ID:4781
Last Review:Thursday, January 08, 2009
Revision:3.0

INTRODUCTION

How to: using SQL to Update Records

symptomsIMPORTANT

How to: using SQL to Update Records


IMPORTANT

How to: using SQL to Delete Records
If you leave off the where clause, all records will be deleted.
back to the top

How to: using SQL to Delete Records


Deleting Records The delete statement is used to delete records or rows from the table.


delete from "tablename"
where "columnname" 
  OPERATOR "value" 
[and|or "column" 
  OPERATOR "value"];

[ ] = optional



[The above example was line wrapped for better viewing on this Web page.]
Examples:
delete from employee;
Note: if you leave off the where clause, all records will be deleted!



delete from employee
  where lastname = 'May';

delete from employee
  where firstname = 'Mike' or firstname = 'Eric';


To delete an entire record/row from a table, enter "delete from" followed by the table name, followed by the where clause which contains the conditions to delete. If you leave off the where clause, all records will be deleted.



  • NOTE: How to: using SQL to Update Records
  • back to the top




    Last Reviewed:1/8/2009
    Keywords: kbHow kbhowtoHow kbHOWTOHow #4781 kbAudITProHow



        Contact

       ©1999-2008 Support at pcplans.com