简体   繁体   English

Gosu查询加入两个表

[英]Gosu Queries to join two tables

How to join below two tables using gosu .. This is from Contact Manager (GW Training App) 如何使用gosu联接下面的两个表。.这来自Contact Manager(GW Training App)

1 ABContact 1 AB联系
2 BankAccount 2个银行账户

Below SQL can be used to find all account hold by one particluar contact 下面的SQL可用于查找一个特定联系人的所有帐户持有权

select b.accountnumber from ABContact a, BankAccount b where
a.id=b.contactid and a.id='123'

Please write the same query in Gosu 请在Gosu中写相同的查询

Query is like this 查询是这样的

uses gw.api.database.Query

var account: BankAccount 
var query = Query.make(ABContact).join("ID", BankAccount, "Contact").compare(BankAccount#ID, Equals, account.ID)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM