A | |
1 | =create(OrderID,Client,SellerID,Amount,OrderDate) |
2 | =A1.record([201,"HDR",9,2100.0,date("2021-01-01"), 202,"IBM",9,1900,date("2021-01-02"), 203,"APPLE",4,1900,date("2021-01-03")]) |
3 | =file("d:/Orders.btx").export@ab(A2) |
A | B | |
1 | =Orders.new(Client,Amount) | // 选出部分字段 |
2 | =Orders.select(Amount>1000 && like(Client,\"*s*\")) | // 模糊查询 |
3 | = Orders.sort(Client,-Amount) | // 排序 |
4 | = Orders.id(Client) | // 去重 |
5 | =Orders.groups(year(OrderDate):y,Client;sum(Amount):amt).select(amt>3000) | // 分组汇总 |
6 | =[Orders.select(Amount>3000),A1.select(year(OrderDate)==2009)].union() | // 并集 |
7 | =Orders.groups(year(OrderDate):y,Client;sum(Amount):amt).select(like(Client,\"*s*\")) | // 子查询 |
8 | =A5.derive(amt/amt[-1]-1: rate) | // 跨行 |
欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) | Powered by Discuz! X3.4 |