-
Notifications
You must be signed in to change notification settings - Fork 690
Delete
Mathias Wulff edited this page Dec 15, 2025
·
9 revisions
Syntax:
DELETE FROM table [WHERE expression]Samples:
alasql('DELETE FROM cities WHERE population < 100000');
alasql('DELETE FROM star WHERE name LIKE "A%"');
alasql('DELETE FROM countries');To delete all records from table:
alasql('DELETE FROM [Table A]');To delete only selected records from table:
var numberOfDeletedLines = alasql('DELETE FROM [Table A] WHERE field1 > 10');You can use the OUTPUT clause to return the deleted data.
// Return all deleted columns
alasql('DELETE FROM cities WHERE population < 100000 OUTPUT DELETED.*');
// Return specific columns
alasql('DELETE FROM cities WHERE population < 100000 OUTPUT DELETED.name, DELETED.population');A DELETE statement will return the amount of rows deleted by the statment.
© 2014-2026, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo