D duke2000 Unregistered / Unconfirmed GUEST, unregistred user! 2006-11-30 #21 因该是正解!只是下载需要数据,而不是删除库里数据!
W why_119 Unregistered / Unconfirmed GUEST, unregistred user! 2006-12-28 #22 select A.* from table1 A, (select userid,max(date) date from table1 group by userid) B where A.userid = B.userid and A.date = B.date 我试了.不行.
select A.* from table1 A, (select userid,max(date) date from table1 group by userid) B where A.userid = B.userid and A.date = B.date 我试了.不行.
W why_119 Unregistered / Unconfirmed GUEST, unregistred user! 2006-12-28 #23 语法错误 (操作符丢失) 在查询表达式 'max(date) date' 中。
沉 沉香屑 Unregistered / Unconfirmed GUEST, unregistred user! 2006-12-28 #24 SQL> select * from test; ID NA USERID D ---------- ---------- ---------- ----------- 10 aaa 3 2006-1-1 12 ccc 4 2006-1-5 13 ddd 4 2006-1-6 11 bbb 3 2006-2-3 SQL> SQL> select t.* from test t where not exists 2 (select * from test where userid=t.userid and d>t.d) 3 ; ID NA USERID D ---------- ---------- ---------- ----------- 13 ddd 4 2006-1-6 11 bbb 3 2006-2-3
SQL> select * from test; ID NA USERID D ---------- ---------- ---------- ----------- 10 aaa 3 2006-1-1 12 ccc 4 2006-1-5 13 ddd 4 2006-1-6 11 bbb 3 2006-2-3 SQL> SQL> select t.* from test t where not exists 2 (select * from test where userid=t.userid and d>t.d) 3 ; ID NA USERID D ---------- ---------- ---------- ----------- 13 ddd 4 2006-1-6 11 bbb 3 2006-2-3
A aa66aa Unregistered / Unconfirmed GUEST, unregistred user! 2006-12-28 #25 修改 hongxing_dl的语句 select A.* from table1 A, (select userid,date0=max(date) date from table1 group by userid) B where A.userid = B.userid and A.date = B.date0 ok吧
修改 hongxing_dl的语句 select A.* from table1 A, (select userid,date0=max(date) date from table1 group by userid) B where A.userid = B.userid and A.date = B.date0 ok吧
T themars Unregistered / Unconfirmed GUEST, unregistred user! 2006-12-28 #26 最好的处理方式 是在插入的时候就做处理 何必要等到写进表里了 再来删除? 写一个 插入的 触发器 在触发器里处理就OK
W why_119 Unregistered / Unconfirmed GUEST, unregistred user! 2006-12-30 #27 谢谢.大家了.. 我在好好测一下... 测好了...给大家加分...