日期:2014-05-16  浏览次数:21085 次

postgre中 delete语句中使用 limit 报错。
看网上说mysql都可以,难道说postgre不能这么用吗?

delete from TBL where column1='11' AND id like '1%' limit 10000

syntax error nera limit at character...

------解决方案--------------------
delete from tbl where pk in (select pk from tbl where column1='11' AND id like '1%' limit 10000)
pk是主键,看看这样行不行。
------解决方案--------------------
假设ID为唯一标识的字段
delete from TBL where id in(select id from tbl where column1='11' AND id like '1%' limit 10000)