摘要:
目的 merge into高效的把临时表中的数据更新到目标表中。 merge into 语法 语法如下: merge into 目标表 a using 源表 b on a.主键=b.主键 and a.条件字段1=b.条件字段1 ... when matched update set a.主键=b.主 阅读全文
摘要:
有时候查询出的某一列结果要作为其他数据库查询条件,必须要做拼接转换 方法: SELECT [id] = stuff((SELECT distinct ',''' + t.id + '''' FROM table t WHERE t.id = 1 FOR xml path ('')),1,1,''); 阅读全文