简体   繁体   中英

Gosu Queries to join two tables

How to join below two tables using gosu .. This is from Contact Manager (GW Training App)

1 ABContact
2 BankAccount

Below SQL can be used to find all account hold by one particluar contact

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

Please write the same query in 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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