Sql server 能否将下面语句的查询结果并列显示,显示效果见图片
selectROW_NUMBER()over(orderbyemp.DCNO)序号,emp.DCNAMECHS员工姓名,IDNTNO身份证号码,emp.Legal地区,b...
select ROW_NUMBER()over (order by emp.DCNO) 序号,emp.DCNAMECHS 员工姓名,IDNTNO 身份证号码,emp.Legal 地区,bx.BSDATE 参保日期,emp.HIRDAT 入职日期,bx.BEDATE 退保日期,gz.发放期间,实际工资 from CSEMPL_1 emp,(select distinct(gz.PERIODID),dcno,DCNAMECHS,PERIODID 发放期间,gz1.BYYFGZ 实际工资 from PRBAT_1 gz,PRBAT_2 gz1where gz.COMNAME=gz1.CMPNAM and PERIODID between SUBSTRING (convert(varchar(6), dateadd(mm,-12,getdate()),112),3,2)+'10' and SUBSTRING (convert(varchar(6),getdate(),112),3,2)+'09') GZ,CSEMPL_28 bx where emp.DCNO=gz.DCNO and emp.VGUID=bx.vguid and bx.BTYPE='2' and emp.HIRDAT between '2015-11-01' --获取每年10月最后一天and CONVERT(varchar,year(getdate()))+'-10-31'
展开
1个回答
展开全部
select uname,uscore,uobject
from Stu_subject
where uscore in
(select distinct top 3 uscore from Stu_subject where uscore > 72 order by uscore desc)
order by uscore desc
你这个语句要报错的吧!~ORACLE是要报错的~MSSQL不会报错?没试过~
from Stu_subject
where uscore in
(select distinct top 3 uscore from Stu_subject where uscore > 72 order by uscore desc)
order by uscore desc
你这个语句要报错的吧!~ORACLE是要报错的~MSSQL不会报错?没试过~
追问
SQL Server数据库,不会报错的
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询