sql表并列
发布时间: 2023-03-05 00:20:14
① sql语句将两个查询结果并列输出
如果是2个SQL语句的话。如果列名都一样,使用UNIONALL就可以了。例如select*from表1UNIONALLselect*from表2就可以了。
② SQL 搜索数据相加 并列显示
select sum(分数) from 表 where 日期=day
select sum(分数) from 表 where 日期=month
select sum(分数) from 表 where 日期=year
③ sql查询(并列)
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不会报错?没试过~
热点内容