SQL中從不同表中連結資料計算

來源:互聯網
上載者:User

從多個表中擷取新的資料表,然後對新資料表的欄位進行計算求值。

select (Number01.N1/Number02.N2)  --get tow table_fieldsfrom(select count(A.field01)as N1 from Table01 A,Table02 Bwhere A.field01=B.field02) Number01,  --like new Table(select count(B.field02) as N2from Table02 B) Number02   --like new Table

多個表的資料需求,也是類似的擷取,然後計算。每個資料的擷取,都類似的像建立了一個新的暫存資料表。




相關文章

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.