Home > Database > Mysql Tutorial > body text

sql 多表返回汇总结果

WBOY
Release: 2016-06-07 14:57:08
Original
1337 people have browsed it

t-sqlcompute函数 目前只在2008里用了。。其他的么有试过 无 with tb(id,product,barcode,qty) as(select 1,'AA',240,3union all select 2,'BB',245,2union all select 3,'AA',255,2union all select 4,'BB',240,1)select * from tb compute sum(qty),sum(bar

t-sql compute函数
目前只在2008里用了。。其他的么有试过
with tb(id,product,barcode,qty) as
(
select 1,'AA',240,3
union all select 2,'BB',245,2
union all select 3,'AA',255,2
union all select 4,'BB',240,1
)

select * from tb compute sum(qty),sum(barcode)
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template