SQL Server 如何自动格式化 SQL 语句 您所在的位置:网站首页 ue代码格式化快捷键 SQL Server 如何自动格式化 SQL 语句

SQL Server 如何自动格式化 SQL 语句

2023-08-31 07:42| 来源: 网络整理| 查看: 265

下面介绍自动格式化的使用,以下面的Sql语句为例,介绍“select b.proj,d.project_name,g.cname,b.id,b.ht_title,isnull(b.htzje,'0') as htzje,isnull(b.yifk,'0') as yifk,sum(isnull(a.je,'0')) as je,g.id as sort from cnto_fk a left join cnto b on a.pid=b.id left join project_table d on b.proj=d.pc_code left join sys_common g on a.fzno=g.cno and g.ctype='cnto_htlx' where 1=1 and d.project_name is not null and a.title is not null and convert(varchar(10),a.sfkrq,120) between '2015-10-01' and '2015-10-31' group by b.proj,d.project_name,g.cname,b.id,b.ht_title,b.htzje,b.yifk,g.id union select a.project_no as proj,d.project_name,g.cname,'' as id,a.title as ht_title,'0' as htzje,sum(isnull(a.je,'0')) as yifk,sum(isnull(a.je,'0')) as je,g.id as sort from cnto_fk a left join project_table d on a.project_no=d.pc_code left join sys_common g on a.fzno=g.cno and g.ctype='cnto_htlx' where a.fzno='qt' and d.project_name is not null and a.title is not null and convert(varchar(10),a.sfkrq,120) between '2015-10-01' and '2015-10-31' group by a.project_no,d.project_name,g.cname,a.title,g.id order by proj,sort”。

点击“新建查询”,打开一个查询编辑窗口,把上面的Sql语句复制粘贴进去,组合快捷键“Ctrl + A”选中这句Sql语句,点击刚才添加在工具栏中的按钮“在编辑器中设计查询”



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有