
s'q'l
程序员-阿勇
这个作者很懒,什么都没留下…
展开
-
sql根据父id查询子项数据
查询所属id及其子项数据with CategoryIds as( select id from ProductCategory where ParentId=102 or id=102 union all select a.id from ProductCategory a join CategoryIds b on a.ParentId=b.Id where a.Par原创 2017-02-24 14:15:42 · 4382 阅读 · 0 评论 -
根据字段关联批量修改关联数据
由于之前2张关联表的数据结构做了变化,一个表的字段移植到了另外一张表。需要将数据也更新过去。百度搜索到,改了下update [dbo].[Product] set[BrandName] = t2 .[BrandName] ,[CompanyId] = t2 .[CompanyId] ,[Unit] = t2 .[Unit] ,[Origin] = t2 .[Orig原创 2017-09-04 11:38:06 · 542 阅读 · 0 评论