The DELETE Statement
The DELETE statement is used to delete rows in a table.
==========================================================
SQL DELETE Syntax
DELETE FROM table_name
WHERE some_column=some_value
example
DELETE from logintable
where id="sam";
==============================================================
DELETE FROM table_name
WHERE some_column=some_value AND some_column=some_value
example
DELETE FROM Persons
WHERE LastName='sam' AND FirstName='231bk'
=====================================================
Delete All Rows
It is possible to delete all rows in a table without deleting the table.
This means that the table structure, attributes, and indexes will be intact:
DELETE FROM table_name;
No comments:
Post a Comment