在C#中的Datatable类中,可以使用DataTable类的Merge方法对两个相同结构的DataTable对象进行求并集运算,将两个DataTable对象的数据行合并到其中一个DataTable变量中,或者说往其中一个DataTable对象中写入另一个DataTable对象的所有数据行.下列例子中使用到DataTable.Clone方法,DataTable.Clone方法用于赋值DataTable的结构信息,包括所有 DataTable 架构和约束. Merge方法的签名为:void Me
select top 100 t2.FullName, * from Subject,(select id, isnull(first_name,'') +isnull(middle_name,'') + ' '+isnull(last_name,'') as FullName from Subject ) T2 where Subject.id = T2.id and T2.id = 372 --update Subject set Subject.full_name = T2.FullNam
效果: oralce写法: select WM_CONCAT(A.title) as citys from tmpcity A sql server写法: select stuff((select ','+A.title from tmpCity A FOR xml PATH('')), 1, 1, '') as citys mysql写法: select GROUP_CONCAT(A.title) as citys from tmpcity A; --默认的逗号分隔select GR