域名

SQL Server数据库中如何合并表格数据

字号+作者:益华科技来源:IT科技2025-11-05 01:23:27我要评论(0)

复制selectA.Date,A.MID,A.Contents1,B.Contents2,B.Passedfrom (selectROW_NUMBER()over(partit

SQL Server数据库中如何合并表格数据
复制select A.Date,数数据A.MID,A.Contents1,B.Contents2,B.Passed from   (select ROW_NUMBER() over(partition by Date order by Date) as MID,Date,Contents as Contents1 from History where Type=0 ) A   left join    (select ROW_NUMBER() over(partition by Date order by Date) as MID,Date,Contents as Contents2,Passed from History where Type=1 ) B   on A.Date=B.Date and A.MID=B.MID   union   select  B.Date,B.MID, A.Contents1,B.Contents2,B.Passed from   (select ROW_NUMBER() over(partition by Date order by Date) as MID,Date,Contents as Contents1 from History where Type=0 ) A   right join    (select ROW_NUMBER() over(partition by Date order by Date) as MID,Date,Contents as Contents2,Passed from History where Type=1) B   on A.Date=B.Date and A.MID=B.MID  1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

相关文章
  • Win10系统如何关闭自动更新(停用Win10系统的自动更新功能以保持更大控制权)

    Win10系统如何关闭自动更新(停用Win10系统的自动更新功能以保持更大控制权)

    2025-11-05 00:08

  • CVE-2021-3115——Golang Windows版本 RCE漏洞

    CVE-2021-3115——Golang Windows版本 RCE漏洞

    2025-11-04 23:20

  • SQL Server数据库的默认端口号

    SQL Server数据库的默认端口号

    2025-11-04 22:53

  • 细数微软Exchange的那些高危漏洞

    细数微软Exchange的那些高危漏洞

    2025-11-04 22:37

网友点评