Removing random rows from a table without knowing anything about table identifiers

I have a problem in mysql. I want to remove 20 rows from a table containing more than 100 records.

I do not know the row identifier, any special identification of the rows that need to be deleted. I want to just remove any random rows from my table.

Please help me ... I'm new to this state.

+4
source share
1 answer

You can do:

DELETE FROM tbl ORDER BY RAND() LIMIT 20 

See MySQL Syntax DELETE

+9
source

All Articles