查询临时表if object_id('')>0查询表中的数据select 'insert into ta1(col1,col2,col3) values('''+ltrim(列1)+''',''''+ltrim(列2)+''','''+ltrim(列3)+''')' from ta2删除重复的数据delete t_news where id not in( select min(id) from t_news group by title)待更新