MySQL Forums
Forum List  »  Newbie

Delete exactly the third row in database
Posted by: dedo mraz
Date: July 22, 2005 07:37AM

Hello, i know that SELECT * FROM x LIMIT 3,1 will select the trird row. But how can i delete exactly the third row? DELETE FROM x LIMIT 3,1 doesnt work. Here is the table that is created.

CREATE TABLE test (a VARCHAR(15), b VARCHAR(15))
INSERT INTO test VALUES ('x','y')
INSERT INTO test VALUES ('x','AAA')
INSERT INTO test VALUES ('x','y') - i want to delete this row wirhout deleting the first one
INSERT INTO test VALUES ('x','AAA')
INSERT INTO test VALUES ('x','AAA')
INSERT INTO test VALUES ('x','y') - or this one without deleting the first and third one
INSERT INTO test VALUES ('x','AAA')

so now you know how the table looks like, but how do i delete the rows that i marked?

DELETE FROM test WHERE a='x' AND b='y' will delete the first added row.

Any ideas? Thank You.

Options: ReplyQuote


Subject
Written By
Posted
Delete exactly the third row in database
July 22, 2005 07:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.