W wangchlai Unregistered / Unconfirmed GUEST, unregistred user! 2008-05-20 #1 我在面试时叫我写出表A里的重复的信息,哪个表的关键字是唯一的,只是植有重复的,需要把重复的用一组SQL语句删掉,我到现在都不会,望高手指点下!
W WilliamGui Unregistered / Unconfirmed GUEST, unregistred user! 2008-05-20 #2 最关键的一句,求F1字段有重复值 select F1 from tablename group by F1 having count(1)>1
L lngdtommy Unregistered / Unconfirmed GUEST, unregistred user! 2008-06-27 #3 只有PK是不重复的,例ID,NAME.... 试试这样 select min(ID) into #temp as B from A group by NAME; delete * from A where ID not in (select ID from B);
只有PK是不重复的,例ID,NAME.... 试试这样 select min(ID) into #temp as B from A group by NAME; delete * from A where ID not in (select ID from B);
L lmk Unregistered / Unconfirmed GUEST, unregistred user! 2008-06-27 #4 delete from tableName where ID not in (select Min(id) from tablename group by value) 和楼上的SQL是一样的
F frankie_24 Unregistered / Unconfirmed GUEST, unregistred user! 2008-06-30 #7 我觉得考你的更喜欢WilliamGui的答案!