假设有一个Users用户表存储在一个名为:SystemManage的数据库中,另有一个Plan计划表存储在一个名为:PlanManage的数据库中,现要求查询给定ID的一条计划表的记录,以及该记录对应的用户的名称,SQL语句
如何来写?
   加数据库名即可用两个点“.”相连:
    select a.UserName ,b.PlanCntent from System..Users as a inner join PlanManage.Plan as b on a.UserID=b.UserID
    where PlanID=@PlanID

相关文章:

  • 2021-08-26
  • 2021-10-02
  • 2021-10-14
  • 2021-12-28
  • 2022-12-23
  • 2021-08-04
  • 2021-05-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2021-08-17
  • 2022-12-23
  • 2021-09-25
相关资源
相似解决方案