lyxcf
中级会员
 
UID 78421
精华
0
积分 309
帖子 205
金钱 309 喜悦币
威望 0
人脉 0
阅读权限 30
注册 2006-8-16 来自 北京 角门北路
状态 离线
|
[广告]: q
m
帮忙改一下这个MYSQL删除语句
delete from cdb_threads where tid not in(
SELECT max(tid)
FROM cdb_threads
WHERE tid >35577
AND tid <47744 and fid=87
GROUP BY subject
HAVING count( * ) >1) 上面在MYSQL是错误的,#1093 - You can't specify target table 'cdb_threads' for update in FROM clause
正确的如何写啊?我要实现的是删除一个表中重复的记录,但要保留一条最新的记录.
[ 本帖最后由 lyxcf 于 2007-6-14 03:58 PM 编辑 ]
|
|