SQL/MX Quick Start (G06.24+, H06.03+)

Changing Information in a Table
HP NonStop SQL/MX Quick Start523724-002
6-3
Deleting Rows From a Table
Deleting Rows From a Table
The DELETE statement deletes entire rows from a table.
Example
Delete the two rows that you inserted in the previous examples. First, display the rows
with part numbers 9998 and 9999:
SELECT * FROM PARTS
WHERE PARTNUM IN (9998, 9999);
Part/Num Part/Desc Price Qty/Avail
-------- ------------------ ------------ -----------
9998 300 BD DATA MODEM 120.00 3
9999 1200 BD DATA MODEM 200.00 12
--- 2 row(s) selected.
Then, using the same WHERE clause, enter:
DELETE FROM PARTS
WHERE PARTNUM IN (9998, 9999);
--- 2 row(s) deleted.
Tip
The WHERE clause specifies the conditions for selecting a row to be deleted. If you
omit the WHERE clause, all rows of the table are deleted. To ensure you are deleting
the correct rows, first display the rows with the WHERE condition you plan to use.