I have a table that looks like this.
CREATE TABLE tshirt
(
id serial,
sku character varying(255) NOT NULL
);
I want to delete only one row with my wanted sku, but DELETE FROM tshirt WHERE sku='%s';
deletes all entries with that sku. How can I do this ?
Go ahead to right click selected cells and select the Delete from the right-clicking menu. And then check the Entire row option in the popping up Delete dialog box, and click the OK button. Now you will see all the cells containing the certain value are removed.
Not the best way but, you could do this:
DELETE FROM tshirt
WHERE id IN (
SELECT id FROM
tshirt WHERE sku='%s' LIMIT 1
)
This SQL Server DELETE TOP example would delete the first record from the employees table where the last_name is 'Anderson'. If there are other records in the employees table that have a last_name of 'Anderson', they will not be deleted by the DELETE TOP statement.
DELETE TOP(1)
FROM employees
WHERE last_name = 'Anderson';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With