示例二
Dim jb As New SQLJoinTableBuilder("查询表1","订单")jb.ConnectionName = "Sale"jb.AddTable("订单","产品ID","产品","产品ID")jb.AddTable("订单", "客户ID","客户","客户ID")jb.AddCols("产品名称","客户名称","日期", "数量","单价")jb.AddExp("金额","数量 * 单价") jb.Build()MainTable = Tables("查询表1")
生成的查询表如下图,产品名称列来自于产品表,客户名称列来自客户表,日期、数量、单价和金额来自于订单表,其中金额列是通过数量和单价计算得出的: