SQL multi-Table return Summary Results

Source: Internet
Author: User
The t-sqlcompute function is currently only used in 2008 .. Others have tried withtb (id, product, barcode, qty) as (select1, AA, 240, 3unionallselect2, BB, 245, 2unionallselect3, AA, 255, 2unionallselect4, BB, 240,1) select * fromtbcomputesum (qty), sum (bar

The t-sqlcompute function is currently only used in 2008 .. Others have tried with tb (id, product, barcode, qty) as (select 1, 'A', 3 union all select 2, 'bb ', 245, 2 union all select 3, 'A', 255, 2 union all select 4, 'bb ',) select * from tb compute sum (qty), sum (bar

T-SQL compute Function
Currently, it is only used in 2008 .. Have you tried anything else? <无>
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(barcode)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.