SQL语句分享[不定期更新]
查询临时表
if object_id('')>0
查询表中的数据
select 'insert into ta1(col1,col2,col3) values('''+ltrim(列1)+''',''''+ltrim(列2)+''','''+ltrim(列3)+''')' from ta2
text 类型的用ltrim(cast([Content] as nvarchar(max)))
删除重复的数据
delete t_news where id not in( select min(id) from t_news group by title)
待更新