MySQL DELETE LIMIT 关键字应用说明


摘要:
下文讲述DELETE LIMIT关键字应用方法,如下所示:



DELETE LIMIT 功能说明

删除符合条件的前几行数据
—————–
DELETE LIMIT 语法说明:
DELETE FROM [数据表] [WHERE 条件] [ORDER BY [排序字段] ASC|DESC]
LIMIT ROWCOUNT
———-参数说明———-
ROWCOUNT:限制删除行数



DELETE LIMIT 举例应用

mysql >DELETE FROM test   WHERE infoA = 'maomao365.com'   ORDER BY infoA DESC   LIMIT 3;
/*
 删除test数据表中前三行数据,  
    数据检索条件为infoA列值等于"maomao365.com" 按照infoA倒序排列
*/